jQuery实现仿微软首页感应鼠标变化滑动窗口效果

这是一款jQuery仿微软首页感应鼠标变化的滑动窗口,鼠标放上后,窗口会向左拉长,鼠标移走后恢复原样,是在微软官方网站发现的,看了看代码,觉得很容易就扣下来,不敢独享。

运行效果截图如下:

jQuery实现仿微软首页感应鼠标变化滑动窗口效果

在线演示地址如下:

具体代码如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>jQuery仿微软首页感应鼠标变化的滑动窗口</title> <meta http-equiv="content-type" content="text/html;charset=gb2312"> <style type="text/css"> .box{width:100px;height:100px;position:absolute;right:0;color:#fff;} .box1{top:100px;background:#000;} .box2{top:250px;background:#333;} .box3{top:400px;background:#666;} .box4{top:550px;background:#999;} </style> <script type="text/javascript" src="https://www.jb51.net/jquery1.3.2.js"></script> </head> <body> <div>应用</div> <div>下载</div> <div>Windows Phone</div> <div>Office</div> <script type="text/javascript"> $('.box').each(function(){ $(this).hover(function(){ $(this).stop().animate({width:'150'},1000); },function(){ $(this).stop().animate({width:'100'},1000); }); }); </script> </body> </html>

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wggwgx.html