"Dropdown" menu with sliding effect
$(document).ready(function() {
//variables
var nav = $(".page__nav");
var nav_item = $(".page__nav ul li")
var sn = $(".page__nav ul ul");
var pc = $(".page__content");
//get the navigations width and set the "left" for the "dropdown"
sn.css("left", nav.width());
//Bind the different events for the items
nav_item.bind("mouseover", open_sub);
nav_item.bind("mouseout", close_sub);
//Open the submenu
function open_sub() {
var this_offset = $(this).offset().top;
$(this).find("ul").css("padding-top", this_offset);
$(this).find("ul").css("min-width", "200px");
}
//Close the submenu
function close_sub() {
$(this).find("ul").css("min-width", "0");
}
});