SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Addict richtestani's Avatar
    Join Date
    Nov 2003
    Location
    Bridgeport
    Posts
    292
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mouseout events occur while mouse is over

    I'm working on a sliding drawer script which uses Prototype/Scriptaculous.

    The script is simple, when I move my mouse over a certain region, the drawer slides out - when my mouse leaves that drawer, it slides back in. For some reason the event seems to occur while my mouse is over.

    Code:
    var slideDrawer = Class.create();
    slideDrawer.prototype = {
    
    	initialize: function(drawerId) {
    		this.drawer = $(drawerId);
    		this.handle = $('handle');
    		
    		$(this.drawer).observe('mouseout',  this.slideOut.bindAsEventListener(this));
    		$(this.handle).observe('mouseover', this.slideIn.bindAsEventListener(this));
    		
    		
    		this.slideOut();
    		
    		
    		
    	},
    	
    	
    	slideIn: function() {
    
    		new Effect.Move (this.drawer,{ x: 0, y: 0, mode: 'absolute'});
    	
    	},
    	
    	slideOut: function() {
    		new Effect.Move (this.drawer,{ x: -200, y: 0, mode: 'absolute'});
    	}
    
    }
    Page in Question

    Any ideas why this is happening?
    Thanks
    Rich
    Last edited by richtestani; Dec 10, 2007 at 11:17.
    RichTestani
    -------------------------------
    http://www.junkdepot.com
    http://www.rareoopdvds.com | The Movie Poster Site

  2. #2
    SitePoint Addict richtestani's Avatar
    Join Date
    Nov 2003
    Location
    Bridgeport
    Posts
    292
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK - I've figured out part of it.

    When I mouse over the drawer area - which sits under the menu, it works as it should. It's when I mouse over a menu item is when a mouseout is envoked.

    How could I set it up, so that the drawer stays open while the mouse is over that area?

    Thanks
    Rich
    RichTestani
    -------------------------------
    http://www.junkdepot.com
    http://www.rareoopdvds.com | The Movie Poster Site


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •