$(function () { /*===================菜单 JS 动作=====================*/ var menus = $(".t_c_bottom ul>li:first").siblings().andSelf(); var thisMenu = $("#thisMenu"); var mt = 161;//默认距离 var mNow = 0;//获取当前的li for (var i = 0; i < menus.length; i++) { if (menus.eq(i).hasClass("thisli")) mNow = i; } //给定 thisli 默认位置 thisMenu.css({ left: (mNow * 104 + mt) + "px" }); menus.hover(function () { MenuMove($(this), ($(this).index() * 104 + mt), 1) }, function () { MenuMove($(this), (mNow * 104 + mt), 0) }); var MenuAuto; function MenuMove(tn, lefts, move) { var ti = tn.index(); var nodes = menus.eq(ti).children(".Nodes"); nodes.stop(); clearTimeout(MenuAuto); var _h = nodes.children("ul").height() + 23;//8个像素是上、下圆角图片高度 15个像素是 div 的 padding 值 if (move === 1) { thisMenu.stop(); thisMenu.animate({ left: lefts + "px" }, 165) nodes.css({ height: "0px" }).animate({ height: _h + "px" }, 300); } else if (move === 0) { nodes.css({ height: _h + "px" }).animate({ height: "0px" }, 300); MenuAuto = setTimeout(function () { thisMenu.animate({ left: lefts + "px" }, 300) }, 1250); } }
文件目录······
暂无数据
猜你喜欢
更多»
项目推荐
更多»
PDF电子书
更多»
Java多线程编程核心技术
(2)
Linux命令详解词典.pdf
(5)
深入Python3中文版
(0)
百度SEO一本通.pdf
(0)
mysql必知必会.pdf
(2)
疯狂JAVA讲义 pdf电子书
(3)
C# 图解教程pdf电子书
(3)
研磨设计模式 pdf电子书
(0)