Results 1 to 2 of 2

Thread: Changing Z-Index in dom-drag

  1. #1
    Join Date
    Jun 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Changing Z-Index in dom-drag

    I'm trying out drag-dom for drag-and-drop functionality but am running into a problem I can't find a solution to by googling.

    I need the last-dragged object to always have the highest Z-Index so that it is always on top.

    The problem is that when my objects (in this case tables) are put into the script's drag-and-drop routine I can no longer alter the Z-Indexes of the tables through conventional means.

    For Example when you click an object it runs dragset:

    var zin=5; (just to show that 'zin' is declared as a global variable)

    function dragset(id)
    {
    document.getElementById("tbl"+id).style.zIndex=zin;
    zin=zin+5;
    }

    Every time around the next table should have a +5 z-index. This works before the tables are entered into the drag & drop script (I know because the one I apply the value to will always remain on top of all others). As soon as the tables are put into the script their Z-Indexes can no longer be altered with the method above.

    Is there another way to alter the Z-Index values on the fly using dom-drag so that the dragged object is always on top?
    Last edited by Snookerman; 06-06-2009 at 10:56 AM.

  2. #2
    Join Date
    Jun 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I figured it out...

    In the "start:" area of the dom-drag script I put in this code:

    zin = zin + 5;
    o.style.zIndex = zin;

    This seems to work nicely.
    Last edited by cdr029; 06-05-2009 at 03:38 PM.

Bookmarks

Posting Permissions

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