Jquery Dropdown

Jquery Dropdown

Create Drop-down menu, Mega menu, Slider-menu from same jquery and CSS.

$(window).load(function(){
// For language DropDown
$(“.language li”).click(function(){
$(this).children(“ul.languageList”) .slideDown(500);
$(this).addClass(“active”);
return false;
});

$(“.language li”).mouseleave(function(){
$(this).children(“ul.languageList”) .slideUp(100);
$(this).removeClass(“active”)
});

//Top menu dropdown
if($(window).width() > 730) {

$(“.topNav li”).hover(function(){
$(this).children(“.topNavDrop”) .slideDown(500);
$(this).addClass(“active”);
return false;
});

$(“.topNav li”).mouseleave(function(){
$(this).children(“.topNavDrop”) .slideUp(100);
$(this).removeClass(“active”)
});

//Top menu dropdown Level2
$(“.topNav li”).hover(function(){
$(this).children(“.topNavDropSub”) .show();
$(this).addClass(“active”);
return false;
});

$(“.topNav li”).mouseleave(function(){
$(this).children(“.topNavDropSub”) .hide();
$(this).removeClass(“active”)
});

} else {
$(“.topNav li”).click(function(){
$(this).children(“.topNavDrop”) .slideDown(500);
$(this).addClass(“active”);
return false;
});

$(“.topNav li”).mouseleave(function(){
$(this).children(“.topNavDrop”) .slideUp(100);
$(this).removeClass(“active”)
});

//Top menu dropdown Level2
$(“.topNav li”).click(function(){
$(“.topNav li”).removeClass(“active”);
$(“.topNavDropSub”).hide();
$(this).children(“.topNavDropSub”) .show();
$(this).addClass(“active”);
return false;
});

}

//slide left menu

$(“.slideMenu li”).click(function(){
$(this).children(“ul.subMenu”) .show();
$(this).addClass(“active”);
return false;
});

$(“.slideMenu li”).mouseleave(function(){
$(this).children(“ul.subMenu”) .hide();
$(this).removeClass(“active”)
});

// For Sitenav DropDown

if($(window).width() > 770) {
var docH = $(document).height();
docH = docH-126;

$(“.siteDropNav”).css(“height”, docH);

$(“.siteNav ul li”).click(function(){
$(this).children(“.siteDropNav”) .slideDown(500);
$(this).addClass(“active”);
return false;
});

$(“.siteNav ul li”).mouseleave(function(){
$(this).children(“.siteDropNav”) .slideUp();
$(this).removeClass(“active”);
});
} else {
$(“.siteNav ul li”).click(function(){
$(“.siteNav ul li”).removeClass(“active”);
$(“.siteDropNav”).hide();
$(this).children(“.siteDropNav”) .slideDown(500);
$(this).addClass(“active”);
return false;
});
}

$(“.bxslider”).bxSlider({
auto: true
});

// mobile nav
$(“.topMobIcon”).click(function(){
$(“.topNav”).slideDown();
});

$(“.siteMobIcon”).click(function(){
$(“.siteNav”).slideDown();
});

$(“.closeNav”).click(function(){
$(this).parent(“.mobNav”).hide();
});

}); // window load end

Download File

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s