Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Senior Coder
    Join Date
    Aug 2002
    Location
    Kansas City, Kansas
    Posts
    1,518
    Thanks
    0
    Thanked 2 Times in 2 Posts

    draggable box woes

    Go to http://www.angelfire.com/art2/pssite/test.html. See my box? Well i want it to be able to be draggable, but i can drag anywhere on the page and it moves. I only want it to move when i am clicking on it. When i made the <div> exactly the same size as the box, when i tried to drag it, it tried to drag the images that its made of. Any suggestions would be great.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That's some ugly, IE only drag code, that will fail when the page is scrolled.
    Suggestion: start from scratch.
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #3
    Senior Coder
    Join Date
    Aug 2002
    Location
    Kansas City, Kansas
    Posts
    1,518
    Thanks
    0
    Thanked 2 Times in 2 Posts
    yeh ur right, if i figure it out, then i will know how to work with it.

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Something I've been playing with, that you may find helpfull:
    http://www.vladdy.net/wca/wintest.html
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by Vladdy
    Something I've been playing with, that you may find helpfull:
    http://www.vladdy.net/wca/wintest.html
    Very cool ... but you know you could go further with that ... draggable elements which also flow with the page - not absolutely positioned at all ...

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by brothercake
    Very cool ... but you know you could go further with that ... draggable elements which also flow with the page - not absolutely positioned at all ...
    As I said this is work in progress. I'm not sure, though, that I would take it the way you suggested i.e. going away with absolute positioning. In the majority of cases (the way I see it) dragging an element means taking it out of normal flow, which implies absolute positioning.
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #7
    Senior Coder
    Join Date
    Aug 2002
    Location
    Kansas City, Kansas
    Posts
    1,518
    Thanks
    0
    Thanked 2 Times in 2 Posts
    thats pretty kewl man, ill check with that when i start working on my box again.

  • #8
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by Vladdy
    In the majority of cases (the way I see it) dragging an element means taking it out of normal flow, which implies absolute positioning.

    Yes it does .. but here's what you can do:

    1 - draw the inital elements as normal HTML; the elements flow as normal, and no resize/reloading is necessary

    2 - when you click on the active part of the box, the original (HTML) box is hidden, and you createElement an entirely new, absolutely-positioned element, which is positioned in the same place (using a recursive offsetWidth/offsetHeight finding function) and you write into it the same innerHTML ... the users never know it isn't the same DIV

    3 - when you let go of it, the element is destroyed, and you simply re-show and the re-arrange the node order of the original element
    Last edited by brothercake; 01-24-2003 at 12:23 PM.

  • #9
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I can do a lot of things, first I gotta figure out what to do them for
    Seriously, if there is a project where such approach can be useful I would do it, but I have not come across one yet...
    What I'm conceptualizing now is bringing the 3rd dimension to the commonly used "2d" layout we inherited from <TABLE> age and this "desktop" approach is one of them.

    your step 2: Actually I would not have to recreate the element, just remove it from the original parent and attach to the document.body changing position to absolute...
    Last edited by Vladdy; 01-24-2003 at 06:55 PM.
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •