Loading ...
Sorry, an error occurred while loading the content.

52477Problem with drag and drog and DIV/Span visibility

Expand Messages
  • Adam Stein
    Mar 8, 2010
    • 0 Attachment
      Using YUI v2.8.0r4 and Firefox v3.5 (on a Linux RedHat Fedora 8 system).

      I've successfully managed to get the drag and drop example
      (http://developer.yahoo.com/yui/examples/dragdrop/dd-reorder.html)
      working in my setup.

      The problem comes in when the list item has a <div> or <span> element
      within it that I want to change the visibility on. Simplified example:

      ...
      <li class="list1" id="li0_0">
      <table>
      <tr>
      <td valign="top">
      <a onclick="toggleContainer("extra"); return false;"
      href="#">
      <img src="/images/expand.jpg" />
      </a>
      <strong>Put Label Here:</strong>
      </td>

      <td>
      Put Value Here

      <div id="extra" style="display: none;">
      <p>Expand/Collapse section</p>
      </div>
      </td>
      </tr>
      </table>
      </li>
      ...

      There is an image that I can click on that calls toggleContainer().
      This function toggles the display style of the "extra" div section.

      Once this list item is dragged, changing the display style has no effect
      (before dragging, it works as expected). Doesn't matter if the item is
      dragged to the other box, moved within the same box, or just dragged to
      nowhere so that it snaps back into place. Once dragged, changing
      display style has absolutely no effect. I get no JavaScript errors,
      just nothing happens. Even line stepped using Firebox to make sure
      toggleContainer() is setting the correct value (div.style.display = ...)
      and that's fine.

      Is <table> screwing things up? I would appreciate any suggestions on
      how to get around this or other things to try to help figure out the
      problem.

      --
      Adam Stein @ Xerox Corporation Email: adam@...

      Disclaimer: Any/All views expressed
      here have been proven to be my own. [http://www.csh.rit.edu/~adam/%5d