jquery动画重复代码 [英] Jquery animation repeating code

查看:81
本文介绍了jquery动画重复代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了代码,但我希望它能够被重复执行,直到用户在页面上。

I have made code but I want it to be execute repeatedly till the user is on the page.

这是我的代码---

                   $(document).ready(

                     function animate() {
                          $('div.lightining').stop().animate({
                            backgroundColor: '#789'
                          }, 1050, 'linear', function() { });
                     }

                     function () { $('div.lightining').cycle(animate()); }

                   );

我希望脚本在完成后重复。
有人会有任何想法来实现这一点。请帮助我!

I want that the script to repeat itself after getting completed. Does someone get any ideas of achieving this. Please help me out!

预先感谢!

推荐答案

           $(document).ready( function() {


             function animate() {
                  $('div.lightining').stop().animate({
                    backgroundColor: '#789'
                  }, 1050, 'linear', function() {  animate(); });
             }

           animate();

           });

这篇关于jquery动画重复代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆