如何使用jquery. animate()图像

how to .animate() image using jquery?

本文关键字:图像 animate 何使用 jquery      更新时间:2023-09-26

我想让一个图像在屏幕上永远旋转:

# # # # # # # HTML
<div class="WideContainerMainShow">
   <div class="ShowStrip"></div>
</div>
# # # # # # # HTML# # # # # # # CSS
.WideContainerMainShow
{
    width:100%;
    overflow:hidden;
    position:relative;
}
.ShowStrip
{
    background-image:url("someimage.png");
    background-repeat:repeat-x;
    width:10000000px;
    position:absolute;
    top:45px;
    right:-550px;
}
# # # # # # # CSS####### Jquery onload页面
$("div .ShowStrip").animate({ 'right': -10000000 }, 300000000);
# # # # # # # Jquery

查看jqueryrotate插件

递归地调用你的animate:

function rotateForever() {
  $("div .ShowStrip").animate({ ... }, 'slow', rotateForever);
}

在onload中,调用rotateForever()

我已经更新了你的代码。我用的不是图片,而是文字。希望能有所帮助http://jsfiddle.net/WRKHk/3/