兼容ie6的图片有由中心逐渐
2016-06-24 14:35
417 查看
图片由中心点逐渐放大,兼容到ie6,如下所示:
<!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>jQuery鼠标悬停图片由中心点逐渐放大效果</title> <style> *{ margin:0; padding:0; list-style:none;} .lanrenzhijia{ width:250px; height:321px; margin:100px auto; position:relative;} .lanrenzhijia img{ position:absolute; left:0; top:0; cursor:pointer;} </style> </head> <body> <div class="lanrenzhijia"> <img src="images/lanren.png" class="pic" /> </div> <script src="http://www.lanrenzhijia.com/ajaxjs/jquery.min.js"></script> <script> $(function(){ $w = $('.pic').width(); $h = $('.pic').height(); $w2 = $w + 30; $h2 = $h + 30; $('.pic').hover(function(){ $(this).stop().animate({height:$h2,width:$w2,left:"-15px",top:"-15px"},500); },function(){ $(this).stop().animate({height:$h,width:$w,left:"0px",top:"0px"},500); }); }); </script> </body> </html>
相关文章推荐
- 相除保留一位小数
- typedef常见用法
- iOS UI篇10- Storyboard(多个Storyboard的连接)
- 1.1字符串旋转--左移,右移x位置--三步反转
- org.springframework.beans.factory.BeanNotOfRequiredTypeException
- mongoVue此实现不是 Windows 平台 FIPS 验证的加密算法的一部分。的解决办法
- swiper的基础使用(十三)
- android-设备信息工具类
- 软件测试实习0624-testNG测试套件
- Java实验(2) Pi的近似值
- Spring整合Shiro做权限控制模块详细案例分析
- Android应用的闪退(crash)分析
- Vector和ArrayList的比较
- iOS之GIF动画文件的播放
- Qt资料大全
- Qt资料大全
- Java中long型转float型那点事
- 一些php东西
- 计时器的几种实现方式
- 简单的多线程理解