Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQuery动画图像旋转_Jquery_Image_Resize_Jquery Animate - Fatal编程技术网

jQuery动画图像旋转

jQuery动画图像旋转,jquery,image,resize,jquery-animate,Jquery,Image,Resize,Jquery Animate,我在使用JS设置图像动画时遇到问题。当我只设置宽度和高度的动画时,效果很好。当我将top/marginTop或left/marginLeft添加到它时,会出现问题。我想使用它的原因是缩放效果。然而,我认为它首先添加了宽度和高度,而不是添加了顶部/左侧值。它会产生“抽搐”的效果,看起来很糟糕,我无法摆脱它 下面是我的简单滑块http://ucko.pl/slider的工作示例/ 我尝试了一切,甚至jQuery.fx.interval=50 感谢您抽出时间我认为您需要根据左侧位置按比例设置宽度动画,

我在使用JS设置图像动画时遇到问题。当我只设置
宽度
高度
的动画时,效果很好。当我将
top/marginTop
left/marginLeft
添加到它时,会出现问题。我想使用它的原因是缩放效果。然而,我认为它首先添加了
宽度
高度
,而不是添加了
顶部/左侧
值。它会产生“抽搐”的效果,看起来很糟糕,我无法摆脱它

下面是我的简单滑块http://ucko.pl/slider的工作示例/

我尝试了一切,甚至
jQuery.fx.interval=50


感谢您抽出时间

我认为您需要根据左侧位置按比例设置宽度动画,根据顶部位置按比例设置高度动画。缩小2px的宽度时,从1px向左错开。

当需要缩放时。。加上这个

-moz-transform: scale(2); 
-webkit-transform: scale(2);
-o-transform: scale(2);

我认为IE的等价物是
-ms transform
,但我没有将其与
scale

一起使用。为了获得更好的效果,必须使用如下CSS属性:

#container{
    overflow:hidden;
    width:489px;
    height:178px;
    position:relative;

}
#container img{
    position:relative;
    margin:auto;
    -webkit-transition: all 4s ease-out;
    -moz-transition: all 4s ease-out;
    -o-transition: all 4s ease-out;
    transition: all 4s ease-out;
}

#container img.zoom { 
   -moz-transform: scale(2);
   -webkit-transform: scale(2);
   -o-transform: scale(2);
   transform: scale(2);
   -ms-transform: scale(2);
filter: progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand',
   M11=2, M12=-0, M21=0, M22=2);
}
和javascript:

$().ready(function(){
    $('img').addClass('zoom');
}); 
添加缩放类时,图像将在4秒内缩放为2


请参阅完整的演示:

我按图像的有效计数比率添加了值,即使在添加100个宽度时将其向左移动50(因此它应该保持在原位并垂直缩放),这是“抽搐”这很好,谢谢,但我仍然无法将缩放的图像移到顶部/左侧。在my
animate
功能中,随机移动缩放图像。使用
top/left
它正在快速“旋转”这不是我需要的,但谢谢你,我终于得到了额外的部分来移动缩放位置,它是
translate(5em,0)这样我可以随机移动缩放:)谢谢,谢谢你的JSFIDLE和你的时间!我有个问题。这种动画在IE中不起作用(目前正在测试IE8)。然而
http://codecanyon.net/item/estro-jquery-ken-burns-slider-wordpress-plugin/full_screen_preview/356713
有效,这是我想要的效果。你能看一下吗?