$(function () { var b = $("#seeAllStores"), a = b.find("a"); b.find("li").hover(function () { if ($.browser.msie && $.browser.version.substr(0, 1) < 7 && $(this).attr("class").indexOf("left") !== -1) { $(this).addClass("menuover-left") } else if (!$.browser.msie) { var v = $(this); if (v.parent('ul').parent('li').length == 1) { v.parent('ul').parent('li').addClass('current') } else { v.parent('ul').parent('div.col').parent('.containerMenu').parent('li').addClass('current'); } } $(this).addClass("menuover"); }, function () { $(this).removeClass("menuover"); if ($.browser.msie && $.browser.version.substr(0, 1) < 7 && $(this).attr("class").indexOf("left") !== -1) { $(this).removeClass("menuover-left") } else if (!$.browser.msie) { var y = $(this); if (y.parent('ul').parent('li').length == 1) { y.parent('ul').parent('li').removeClass('current') } else { y.parent('ul').parent('div.col').parent('.containerMenu').parent('li').removeClass('current'); } } }); a.blur(function () { $(this).parent("li").removeClass("menuover") }); a.focus(function () { $(this).parents("li").addClass("menuover") }); b.find("li:has(ul,div.containerMenu) a:last-child").blur(function () { $(this).parents("li").removeClass("menuover") }); b.find("li:has(ul,div.containerMenu)").addClass("hasChild"); }); $.fn.cascadingMenu = function (c) { c = $.extend({ iframe: false, animate: false, animateOut: false, animateSpeed: 500, easing: "linear" }, c); var a = $(this), b = a.find("> ul li.hasChild:not(:has(div.containerMenu)) ul, > ul li.hasChild:not(:has(div.containerMenu)) li.hasChild ul, li > div.containerMenu"); if ($.browser.msie && $.browser.version.substr(0, 1) < 7 && c.iframe === true) { b.each(function () { $(this).prepend("<iframe onfocus=\"if (window.event.shiftKey) {$(this).parents('li:first').find('a:first').focus();}else{$(this).next('li:first').find('a:first').focus();}\" style=\"position:absolute; top:0; left:0; z-index:-1; filter:mask(); width:" + this.offsetWidth + "px;height:" + this.clientHeight + 'px;" frameborder="0"></iframe>') }) } if (c.animate !== false) { b.each(function () { var d = $(this); d.parent("li").hover(function () { var g = "0px", f = "0px", e = "0px"; g = d.css("left"); f = d.css("top"); e = d.css("right"); d.css({ left: g, top: f, right: e }); if (d.parent("li").hasClass("left") === true || d.parents("li").hasClass("left") === true) { d.css({ left: "auto", right: "0" }) } if (c.animate === "fade") { d.stop(true, true).hide().fadeIn(c.animateSpeed, c.easing) } else { if (c.animate === "slide") { d.stop(true, true).hide().slideDown(c.animateSpeed, c.easing) } } }, function () { if (c.animateOut === "fade") { d.stop().fadeOut(150, function () { d.attr("style", "").show() }) } else { if (c.animateOut === "slide") { d.stop().slideUp(150, function () { d.attr("style", "").show() }) } else { d.stop(true, true).attr("style", "").show() } } }) }) } };
