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

Strange dragdrop error: page scrolls on click

Expand Messages
  • jessekeller
    This takes a little explaining, but hopefully it will make sense to someone: I ve got a with a bunch of items, some of which contain other s. The
    Message 1 of 3 , May 31, 2007
    View Source
    • 0 Attachment
      This takes a little explaining, but hopefully it will make sense to
      someone:

      I've got a <ul> with a bunch of items, some of which contain other
      <ul>'s. The list items are all draggable -- you can pick them up and
      drag them onto other list items.

      They are also clickable. A typical list item looks like this:

      <li>Some text here
      <a target="_blank" href="...">link 1</a>
      <a target="_blank" href="...">link 2</a>
      <ul>
      <li><a target="_blank" href="...">link 3</a></li>
      </ul>
      </li>

      The problem is this: when you click on one of the links, *sometimes*
      instead of actually following the link, the page simply scrolls up
      (toward the top of the page) about 4 lines. Once this happens to one
      list item, it tends to happen to *all* list items, even ones that
      worked correctly previously. This effect happens in both IE7 and FF2
      (win) -- but it goes away when I comment out the following line in my
      list creation script:

      new YAHOO.example.DDList(myItem.id);

      Of course, so does the dragdrop functionality.

      Anybody have any idea why this might be happening -- or how to stop it?

      Thanks!


      (Here's the code for DDList -- cribbed from a YUI example:)

      YAHOO.example.DDList = function(id, sGroup, config) {

      if (id) {
      this.init(id, sGroup, config);
      this.resizeFrame = false;
      this.initFrame();
      }

      };

      YAHOO.extend(YAHOO.example.DDList, YAHOO.util.DDProxy);
    • Adam Moore
      ... This is due to the fact that the auto-scroll code is kicking in before it should in DDProxy implementations. A workaround can be found here:
      Message 2 of 3 , May 31, 2007
      View Source
      • 0 Attachment
        On Thu, May 31, 2007 at 08:13:33PM -0000, jessekeller wrote:
        > This takes a little explaining, but hopefully it will make sense to
        > someone:
        >
        > I've got a <ul> with a bunch of items, some of which contain other
        > <ul>'s. The list items are all draggable -- you can pick them up and
        > drag them onto other list items.
        >
        > They are also clickable. A typical list item looks like this:
        >
        > <li>Some text here
        > <a target="_blank" href="...">link 1</a>
        > <a target="_blank" href="...">link 2</a>
        > <ul>
        > <li><a target="_blank" href="...">link 3</a></li>
        > </ul>
        > </li>
        >
        > The problem is this: when you click on one of the links, *sometimes*
        > instead of actually following the link, the page simply scrolls up
        > (toward the top of the page) about 4 lines.

        This is due to the fact that the auto-scroll code is kicking in before it
        should in DDProxy implementations. A workaround can be found here:

        http://tech.groups.yahoo.com/group/ydn-javascript/message/12966

        -Adam
      • jessekeller
        Thank you! That fixed the problem. Jesse ... before it
        Message 3 of 3 , Jun 1, 2007
        View Source
        • 0 Attachment
          Thank you! That fixed the problem.

          Jesse

          > > The problem is this: when you click on one of the links, *sometimes*
          > > instead of actually following the link, the page simply scrolls up
          > > (toward the top of the page) about 4 lines.


          > This is due to the fact that the auto-scroll code is kicking in
          before it
          > should in DDProxy implementations. A workaround can be found here:
          >
          > http://tech.groups.yahoo.com/group/ydn-javascript/message/12966
          >
          > -Adam
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.