onhover Emulation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • exiquio

    onhover Emulation

    So a client requires a useless column on the page that contains
    employee profile blocks with little images in them. The div tag
    containing the content has an overflow of hidden. It contains more
    profile blocks that can be seen. The task is to have the thing scroll
    through the profiles when a user hovers the edge. I have it scrolling
    one block at a time 'onclick'. My question is this: Is there a simple,
    efficient way to capture a continuous mouse hover? I guess I could
    keep checking the mouse position, but that seems too inefficient to be
    the best way.

    Thanks.
  • Joost Diepenmaat

    #2
    Re: onhover Emulation

    exiquio <exiquio@gmail. comwrites:
    >My question is this: Is there a simple, efficient way to capture a
    >continuous mouse hover? I guess I could keep checking the mouse
    >position, but that seems too inefficient to be the best way.
    You can't "keep checking the mouse position". Just use mousemove events.

    --
    Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/

    Comment

    • Joost Diepenmaat

      #3
      Re: onhover Emulation

      exiquio <exiquio@gmail. comwrites:
      On Feb 25, 7:11 pm, Joost Diepenmaat <jo...@zeekat.n lwrote:
      >
      That doesn't seem to work. The initial mouse over causes the event to
      trigger, but there is not action to follow. I am using mootools for
      this. Here is the code:
      [snip]

      You want some kind of timeout/interval event to scoll on while the mouse
      hasn't move out of the element. I'm not familiar with the library you're
      using. You also don't need [code] tags to post code. This is usenet. We
      tend to use plain text.

      --
      Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/

      Comment

      • exiquio

        #4
        Re: onhover Emulation

        On Feb 25, 7:24 pm, Joost Diepenmaat <jo...@zeekat.n lwrote:
        exiquio <exiq...@gmail. comwrites:
        On Feb 25, 7:11 pm, Joost Diepenmaat <jo...@zeekat.n lwrote:
        >
        That doesn't seem to work. The initial mouse over causes the event to
        trigger, but there is not action to follow. I am using mootools for
        this. Here is the code:
        >
         [snip]
        >
        You want some kind of timeout/interval event to scoll on while the mouse
        hasn't move out of the element. I'm not familiar with the library you're
        using. You also don't need [code] tags to post code. This is usenet. We
        tend to use plain text.
        >
        --
        Joost Diepenmaat | blog:http://joost.zeekat.nl/| work:http://zeekat.nl/
        Thanks. My bad about the tags.

        Comment

        • exiquio

          #5
          Re: onhover Emulation

          On Feb 25, 7:27 pm, exiquio <exiq...@gmail. comwrote:
          On Feb 25, 7:24 pm, Joost Diepenmaat <jo...@zeekat.n lwrote:
          >
          >
          >
          exiquio <exiq...@gmail. comwrites:
          On Feb 25, 7:11 pm, Joost Diepenmaat <jo...@zeekat.n lwrote:
          >
          That doesn't seem to work. The initial mouse over causes the event to
          trigger, but there is not action to follow. I am using mootools for
          this. Here is the code:
          >
           [snip]
          >
          You want some kind of timeout/interval event to scoll on while the mouse
          hasn't move out of the element. I'm not familiar with the library you're
          using. You also don't need [code] tags to post code. This is usenet. We
          tend to use plain text.
          >
          --
          Joost Diepenmaat | blog:http://joost.zeekat.nl/|work:http://zeekat.nl/
          >
          Thanks. My bad about the tags.
          So here is the working code. I will change the intervals, but that
          isn't important. Thanks Joost.

          window.addEvent ('domready', function(){
          // Create a global namespace API
          var JD = function(){
          /* PRIVATE */
          // Create a scrolling object for the team box
          var team_scroll = new Fx.Scroll(
          'team_side_bar' ,
          {
          duration: 1000
          }
          );
          var position = 0;
          /* END PRIVATE */

          /* PUBLIC */
          return{
          init: function(){
          // Register events for team bar scrolling
          var topTriggerTimer = function(){};
          var bottomTriggerTi mer = function(){};
          // TODO (exiquio) adjust pixels
          $('top_trigger' ).addEvent('mou seenter', function(event) {
          topTriggerTimer = (function(){
          team_scroll.scr ollTo(0, position - 116);
          position = position - 116;
          }).periodical(1 500);
          });
          $('top_trigger' ).addEvent('mou seleave', function(event) {
          $clear(topTrigg erTimer);
          });
          $('bottom_trigg er').addEvent(' mouseenter', function(event) {
          bottomTriggerTi mer = (function(){
          team_scroll.scr ollTo(0, position + 116);
          position = position + 116;
          }).periodical(1 500);
          });
          $('bottom_trigg er').addEvent(' mouseleave', function(event) {
          $clear(bottomTr iggerTimer);
          });
          }
          }
          /* END PUBLIC */
          }();
          // Call init()
          JD.init();
          });

          Comment

          Working...