炫酷动态菜单——很简单

偶然有一个别人说个网站的网址不错,于是便自己尝试用最简单的方法实现,于是便有了这个效果

http://demo.qpdiy.com/hxw/%E5%8A%A8%E6%80%81%E8%8F%9C%E5%8D%95/h/index.html

刚开始的时候如果鼠标从菜单头到尾的话背景移动会在每个点都会停顿一下,后来进行了改进

源代码是

focus.animate({left:position},'fast');

改为

focus.clearQueue().animate({left:position},'fast');

果然效果就流畅多了

clearQueue() 能够清除任何排队的函数(通过 .queue() 方法添加到通用 jQuery 队列的任何函数)。

原效果网站http://bbs.feng.com/read-htm-tid-5734484.html

原文地址:https://www.cnblogs.com/huangxiaowen/p/3956074.html