Home >Web Front-end >JS Tutorial >jQuery gradient drop-down menu_jquery

jQuery gradient drop-down menu_jquery

WBOY
WBOYOriginal
2016-05-16 18:39:06969browse

The main purpose here is to use slideToggle() and slideUp() to display the originally hidden content when the mouse passes over it (.hover()):

Copy code The code is as follows:

$(function(){
$(".dropdown").hover(
function(){ $("li ul ").slideToggle(800);},
function(){$("li ul").slideUp(1000)}
)
})

jQuery gradient drop-down menu_jquery
Copy code The code is as follows:





jQuery gradient effect






;

Use slideToggle and slideUp to implement. Of course, you can also use hide/show, fadeIn/fadeOut, etc., but the effect is different, the implementation method is still the same. Things to note Yes, you need to add position:relative; to .dropdown to prevent flickering.










Test code package download
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn