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

Scroll event only triggers once per event.

Expand Messages
  • tommykim07
    I am trying to make a custom scroller where the user can hover their mouse over an arrow and it will scroll the window down. I tried getting this effect with
    Message 1 of 3 , Dec 28, 2006
    • 0 Attachment
      I am trying to make a custom scroller where the user can hover their
      mouse over an arrow and it will scroll the window down. I tried
      getting this effect with the scroll method from the animation
      examples. I tried to use the "by" attribute so that it will scroll by
      40px when the mouse is over the arrow picture. However, I noticed that
      it only triggers once and it scrolls the text down by 40px then stops
      even though the mouse is still over the arrow picture. I have to take
      the mouse off of it then move it back for it to scroll down another 40px.

      Is there a way I can have it keep calling it while the mouse is over
      the arrow picture? And when the mouse if off it will stop scrolling??
    • jcobbers
      Hi Tommy, I hope we can help you. Could you post an example of your code you are using? Thanks. My initial guess is you are having the event that fires it the
      Message 2 of 3 , Dec 29, 2006
      • 0 Attachment
        Hi Tommy,

        I hope we can help you. Could you post an example of your code you are
        using?

        Thanks.

        My initial guess is you are having the event that fires it the hover
        event. Thus after you've hovered once, it'll scroll by X pixels and
        then stop.

        Just off the top of my head, I'm pretty new to YUI: Could you somehow
        have your own function that continuously scrolls.

        If nothing else, I hope I've bumped your post towards the top of the
        list again (-;

        jonathan



        --- In ydn-javascript@yahoogroups.com, "tommykim07"
        <blademaster_orcs@...> wrote:
        >
        > I am trying to make a custom scroller where the user can hover their
        > mouse over an arrow and it will scroll the window down. I tried
        > getting this effect with the scroll method from the animation
        > examples. I tried to use the "by" attribute so that it will scroll by
        > 40px when the mouse is over the arrow picture. However, I noticed that
        > it only triggers once and it scrolls the text down by 40px then stops
        > even though the mouse is still over the arrow picture. I have to take
        > the mouse off of it then move it back for it to scroll down another
        40px.
        >
        > Is there a way I can have it keep calling it while the mouse is over
        > the arrow picture? And when the mouse if off it will stop scrolling??
        >
      • 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 3 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.