【发布时间】:2013-04-30 07:23:57
【问题描述】:
我想在悬停时旋转和放大图片(平滑)。我正在使用 JqueryRotate 旋转图片并使用 .animate() 进行放大。 我得到以下代码:
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script src="scripts/jQueryRotateCompressed.2.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#test").hover(
function(){
$(this).rotate({animateTo:30})
$(this).stop().animate({width:'90px',height:'90px'}, 500 );
},
function(){
$(this).rotate({animateTo:0})
$(this).stop().animate({width:'34px',height:'34px'}, 500);
});
});
</script>
----->我的头代码
<body>
<img id="test" src="images/facebook.png" />
</body>
现在这在 Firefox、Chrome 和 Safari 中完美运行......但当然 IE 是一个皮塔饼。 我现在正在 IE8 上进行测试,它确实会旋转,但由于某种原因它不会放大.. 如果我在没有旋转的情况下测试功能,它会放大就好了......所以这是 2 的组合在 IE8 中不起作用.有人知道解决方案吗?谢谢
【问题讨论】:
-
如果您正在为包含图像的 div 设置动画,请尝试在 css 中将图像宽度/高度设置为 100%,以使其适合 div。
-
这不是问题,它在所有浏览器中都可以正常工作,但在 IE 中它只是旋转,但不会放大...查看我的工作示例,这样你就知道我的意思了:jsfiddle.net/Xn2ep
标签: jquery rotation jquery-animate