$(function () { var $menu = $(".menu"), $menuli = $menu.find("li"), $current = $menu.find('.current'), $li_2 = $menu.find('li.li_2'), $li_2_content = $li_2.find('.li_2_content'); $menuli.hover(function () { var $this = $(this), num = $menuli.index($this), current = $menuli.index($(".first")), len = current - num; $menu.css("background-position", (101 * current) + "px" + " bottom"); $current.removeclass("lihover"); $menuli.removeclass("first"); $this.addclass("first"); if (len <= 0) { len = -len; }; if (num != 4) { $menu.stop().animate({ backgroundposition: (101 * num) + "px" + " bottom" }, 100 * len); } else { $menu.stop().animate({ backgroundposition: (101 * num + 30) + "px" + " bottom" }, 100 * len); } }); $li_2.hover(function () { $li_2_content.stop(true, true).fadein(0); }, function () { $li_2_content.fadeout(500, function () { $li_2_content.css("display", "none"); }); }); $menu.mouseleave(function () { var $this = $(this), num = $menuli.index($this), current = $menuli.index($current), len = current - num; $menuli.removeclass("first"); $current.addclass("first"); if (len <= 0) { len = -len; }; $menu.stop().animate({ backgroundposition: (100 * current + 1) + "px" + " bottom" }, 100 * len); }); $("a.noclick").click(function (event) { event.preventdefault(); }); }); $(function () { var $menu = $(".menu"), $menuli = $menu.find("li"), $current = $menu.find('.current'), $li_3 = $menu.find('li.li_3'), $li_3_content = $li_3.find('.li_3_content'); $menuli.hover(function () { var $this = $(this), num = $menuli.index($this), current = $menuli.index($(".first")), len = current - num; $menu.css("background-position", (101 * current) + "px" + " bottom"); $current.removeclass("lihover"); $menuli.removeclass("first"); $this.addclass("first"); if (len <= 0) { len = -len; }; if (num != 4) { $menu.stop().animate({ backgroundposition: (101 * num) + "px" + " bottom" }, 100 * len); } else { $menu.stop().animate({ backgroundposition: (101 * num + 30) + "px" + " bottom" }, 100 * len); } }); $li_3.hover(function () { $li_3_content.stop(true, true).fadein(0); }, function () { $li_3_content.fadeout(500, function () { $li_3_content.css("display", "none"); }); }); $menu.mouseleave(function () { var $this = $(this), num = $menuli.index($this), current = $menuli.index($current), len = current - num; $menuli.removeclass("first"); $current.addclass("first"); if (len <= 0) { len = -len; }; $menu.stop().animate({ backgroundposition: (100 * current + 1) + "px" + " bottom" }, 100 * len); }); $("a.noclick").click(function (event) { event.preventdefault(); }); }); $(function () { var $menu = $(".menu"), $menuli = $menu.find("li"), $current = $menu.find('.current'), $li_4 = $menu.find('li.li_4'), $li_4_content = $li_4.find('.li_4_content'); $menuli.hover(function () { var $this = $(this), num = $menuli.index($this), current = $menuli.index($(".first")), len = current - num; $menu.css("background-position", (101 * current) + "px" + " bottom"); $current.removeclass("lihover"); $menuli.removeclass("first"); $this.addclass("first"); if (len <= 0) { len = -len; }; if (num != 4) { $menu.stop().animate({ backgroundposition: (101 * num) + "px" + " bottom" }, 100 * len); } else { $menu.stop().animate({ backgroundposition: (101 * num + 30) + "px" + " bottom" }, 100 * len); } }); $li_4.hover(function () { $li_4_content.stop(true, true).fadein(0); }, function () { $li_4_content.fadeout(500, function () { $li_4_content.css("display", "none"); }); }); $menu.mouseleave(function () { var $this = $(this), num = $menuli.index($this), current = $menuli.index($current), len = current - num; $menuli.removeclass("first"); $current.addclass("first"); if (len <= 0) { len = -len; }; $menu.stop().animate({ backgroundposition: (100 * current + 1) + "px" + " bottom" }, 100 * len); }); $("a.noclick").click(function (event) { event.preventdefault(); }); }); $(function () { var $menu = $(".menu"), $menuli = $menu.find("li"), $current = $menu.find('.current'), $li_5 = $menu.find('li.li_5'), $li_5_content = $li_5.find('.li_5_content'); $menuli.hover(function () { var $this = $(this), num = $menuli.index($this), current = $menuli.index($(".first")), len = current - num; $menu.css("background-position", (101 * current) + "px" + " bottom"); $current.removeclass("lihover"); $menuli.removeclass("first"); $this.addclass("first"); if (len <= 0) { len = -len; }; if (num != 4) { $menu.stop().animate({ backgroundposition: (101 * num) + "px" + " bottom" }, 100 * len); } else { $menu.stop().animate({ backgroundposition: (101 * num + 30) + "px" + " bottom" }, 100 * len); } }); $li_5.hover(function () { $li_5_content.stop(true, true).fadein(0); }, function () { $li_5_content.fadeout(500, function () { $li_5_content.css("display", "none"); }); }); $menu.mouseleave(function () { var $this = $(this), num = $menuli.index($this), current = $menuli.index($current), len = current - num; $menuli.removeclass("first"); $current.addclass("first"); if (len <= 0) { len = -len; }; $menu.stop().animate({ backgroundposition: (100 * current + 1) + "px" + " bottom" }, 100 * len); }); $("a.noclick").click(function (event) { event.preventdefault(); }); }); $(function () { var $menu = $(".menu"), $menuli = $menu.find("li"), $current = $menu.find('.current'), $li_6 = $menu.find('li.li_6'), $li_6_content = $li_6.find('.li_6_content'); $menuli.hover(function () { var $this = $(this), num = $menuli.index($this), current = $menuli.index($(".first")), len = current - num; $menu.css("background-position", (101 * current) + "px" + " bottom"); $current.removeclass("lihover"); $menuli.removeclass("first"); $this.addclass("first"); if (len <= 0) { len = -len; }; if (num != 4) { $menu.stop().animate({ backgroundposition: (101 * num) + "px" + " bottom" }, 100 * len); } else { $menu.stop().animate({ backgroundposition: (101 * num + 30) + "px" + " bottom" }, 100 * len); } }); $li_6.hover(function () { $li_6_content.stop(true, true).fadein(0); }, function () { $li_6_content.fadeout(500, function () { $li_6_content.css("display", "none"); }); }); $menu.mouseleave(function () { var $this = $(this), num = $menuli.index($this), current = $menuli.index($current), len = current - num; $menuli.removeclass("first"); $current.addclass("first"); if (len <= 0) { len = -len; }; $menu.stop().animate({ backgroundposition: (100 * current + 1) + "px" + " bottom" }, 100 * len); }); $("a.noclick").click(function (event) { event.preventdefault(); }); });