English 中文(简体)
Jquery Timers - Cant 停下来 时间选择
原标题:Jquery Timers - Cant stop everyTime loop

I have a little animation that makes elements bob up and down. Each element bobs at a slightly different speed and amount. I m using Jquery Timers (http://plugins.jquery.com/project/timers) everyTime function to infinitely loop the animation.

我已成功地走了这些要素,以克服和缩小,但我可以不让他们停止使用停职。

这就是我迄今为止所做的事情:

function randomFromTo(from, to){
   return Math.floor(Math.random() * (to - from + 1) + from);
}

    function bobbing(command){

       if(command== start ){
          $("#scroller .feature-headline").each(function (i) {
             $(this).everyTime(1,  bobbing , function (){
                var bobAmount = randomFromTo(5, 10);
                var bobSpeed = randomFromTo(1200, 2000);
                $(this).animate ({marginTop: bobAmount}, bobSpeed,  linear ).animate ({marginTop: 0}, bobSpeed,  linear );
             });
          });
       } else {
          $("#scroller .feature-headline").each(function (i) {
             $(this).stopTime( bobbing );
          });
       }

    }

在什么地方我错了?

最佳回答

这份指南对停机和停电作了区分。 完全停止估计就是一例。

$( "#ball_holder").stop(true).stopTime();

......

$(this).stop(true).stopTime( bobbing );
问题回答

暂无回答




相关问题
How do I wait for a TTimer to finish?

I have a TFrame (fraDisplay) with a TTimer (timAnimateDataChange). The timer is used to control a small animation. In the form containing the frame I want to have a method that does something like ...

How to tell if an ajax timer has gone off at page_load

I have a web application and I m attempting to put an ajax timer control in it to give me a post back every 10-20 seconds. (possibly longer depending on performance). I have a lot of dynamically ...

Got an error 1120 ~ Access of undefined property

This is not your typical 1120. I know better than to have buttons/MCs without instance names on the timeline. Nope, this problem resides in a I timer I built from script I found online. The undefined ...

what is the right way to call the Timer ElapsedEventHandler

i have a timer that calls its even handler method every 30 seconds. but i want to initialy call this method. the signature of the event handler method is void TimerElapsed_GenerateRunTimes(object ...

Timer for a polling windows service

I wrote a Timer class in order to use it within a windows service that is polling another system. I did this because I had two issues that the System.Timers.Timer is not addressing. The Elapsed ...

Using C# Timer to stop executing a Program

I want a program to stop executing for a certain amount of time. And i want this to happen in regular intervals. For example, i want a program to run for 5 minutes and then it should stop for 2 ...

热门标签