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

Re: Scroll event only triggers once per event.

Expand Messages
  • tommykim07
    Here is an example of the code I m working with. Basically when the mouse is over TopScrollBar it should scroll YahooMessengerMain up and when mouse is over
    Message 1 of 3 , Jan 3, 2007
    • 0 Attachment
      Here is an example of the code I'm working with. Basically when the
      mouse is over TopScrollBar it should scroll YahooMessengerMain up and
      when mouse is over BottomScrollBar it should scroll down. A really
      good example of what I am trying to achieve is the Amazon.com Yahoo
      Messenger Plugin.

      If you have yahoo messenger and load the amazon.com plug in you can
      see that there are arrows on the top and bottom. I have my aspx page
      set up in a similar fashion. However, like you said, it will only
      trigger once per mouseover so I don't get the continuous scrolling.
      Please help me find a way to keep calling this method to keep
      scrolling until mouse is off of the arrows.

      YAHOO.example.moveUp = function() {

      var anim = new YAHOO.util.Scroll('YahooMessengerMain', { scroll: {
      by: [0, -30] } });
      YAHOO.util.Event.on(TopScrollBar, 'mouseover', anim.animate, anim,
      true);

      };

      YAHOO.util.Event.onAvailable('YahooMessengerMain', YAHOO.example.moveUp);

      YAHOO.example.moveDown = function() {

      var anim = new YAHOO.util.Scroll('YahooMessengerMain', { scroll: {
      by: [0, 30] } });

      YAHOO.util.Event.on(BottomScrollBar, 'mouseover', anim.animate,
      anim, true)

      };

      YAHOO.util.Event.onAvailable('YahooMessengerMain',
      YAHOO.example.moveDown);

      I have actually tried putting a while(var x > someNumber) and try keep
      calling var anim = new YAHOO.util.Scroll('YahooMessengerMain', {
      scroll: { by: [0, 30] } }); and keep incrementing x thinking that it
      will keep calling it until x is less then someNumber, but it didn't work.
    Your message has been successfully submitted and would be delivered to recipients shortly.