Skip to content

Instantly share code, notes, and snippets.

@jakejscott
Created May 13, 2011 11:27
Show Gist options
  • Save jakejscott/970376 to your computer and use it in GitHub Desktop.
Save jakejscott/970376 to your computer and use it in GitHub Desktop.
Simple image mouseover rollover
var timeout;
$('.map-img').live('mouseover', function() {
var $this = $(this);
var $us = $this.parent().children();
timeout = setInterval(function() {
if ($us.filter(':visible').length == 1) {
var last = $us.last();
last.fadeIn(function(){
last.siblings().show();
});
} else {
$this.fadeOut();
}
}, 3000);
});
$('.map-img').live('mouseleave', function() {
clearTimeout(timeout);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment