Home > Web Front-end > JS Tutorial > body text

jQuery gradient drop-down menu_jquery

WBOY
Release: 2016-05-16 18:39:06
Original
943 people have browsed it

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
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template