Wednesday, January 13, 2010

JQuery Animations: Sliding and Fading

Wanted to do a slide-out and fade-in menu upon hover, and slide-in and fade-out when mouse is out of the menu. Optimum is to put in a timer delay as well.

Code I am currently referencing:
$("#Menu-header").hover(function() {
$("#Menu-content").animate({ opacity: "show", height: "show" }, "slow");
});
// mouse leaves the content area
$("#Menu-content").mouseleave(function() {
setTimeout(function() {
$("#Menu-content").animate({ opacity: "hide", height: "hide" }, 900);}, 1000);
});

Resources:

No comments:

Post a Comment