Posted By

pntp on 03/09/11


Tagged

jquery roller toggledisplay


Versions (?)

Show on when mouse on an trigger object and remain show when mouse on an viewing object


 / Published in: JavaScript
 

The object will be hide after the mouse out viewing object and trigger object.

  1. $('.prodrop4 .top').each(function(){
  2. $(this).mouseenter(function(event){// trigger object
  3. $('.roller').css('z-index', '1000');
  4. $('.roller').css('top', $(this).outerHeight());
  5. $('.roller').css('left', $(this).position().left);
  6. $('.roller').mouseenter();
  7. });
  8. $(this).mouseleave(function(event){
  9. $('.roller').mouseleave();
  10. });
  11.  
  12. $('.roller').mouseenter(function(event){
  13. window.clearTimeout($roller_timer);
  14. $('.roller').show(200);
  15. $block = false;
  16. });
  17. $('.roller').mouseleave(function(event){
  18. if(!$block){
  19. $roller_timer = window.setTimeout(function(){
  20. $('.roller').hide(200);
  21. }, 200);
  22. }
  23. $block=true;
  24. });
  25. })

Report this snippet  

You need to login to post a comment.