【发布时间】:2013-08-03 11:29:11
【问题描述】:
我自己很努力,但解决了我的问题。 我的查询是: 我有一个图像,我想将此图像旋转为从开始以慢动作翻转到 90 度,然后以相同的方式返回 90 度。 请告诉我解决方案,我该怎么做?
提前致谢。
我使用了这个代码
<style type='text/css'>
.img {
transform: scale(-1, 1);
-moz-transform: scale(-1, 1);
-webkit-transform: scale(-1, 1);
-o-transform: scale(-1, 1);
-khtml-transform: scale(-1, 1);
-khtml-transform: scale(-1, 1);
-khtml-transform:speed 5s;
-khtml-transform:speed 5s; /* Safari */
}
</style>
<script type='text/javascript'>//<![CDATA[
$(window).load(function(){
/*$('#image').mouseover(function(){
$(this).addClass('img');
}).mouseleave(function(){
$(this).removeClass('img');
});*/
//setTimeout(addclass(),5000)
setTimeout(function(){ addclass(); },5000);
});//]]>
function addclass(){
$("#add_remove").hide();
$("#image").addClass('img');
setTimeout(function(){ removeclass(); },5000);
}
function removeclass(){
$("#add_remove").show();
$("#image").removeClass('img');
setTimeout(function(){ addclass(); },5000);
}
</script>
</head>
<body>
<img id="image" src="robot_upper.png"/>
</body>
【问题讨论】:
-
请在问题中包含您尝试过的内容。
-
欢迎来到 SO!分享您尝试过的内容并具体说明您面临的确切问题是个好主意
-
你为什么不谷歌
image processing或image rotation?或者向我们展示您尝试编写但失败的代码? -
寻找 CSS3 变换和过渡。
标签: javascript jquery css animation jquery-animate