Setinterval And Function
I have written this simple function: HTML:
Solution 1:
Your setInterval
will attempt to call the function inters()
every 3 seconds, which is probably not what you want.
What I think you want to execute is the following line:
$('#topt').inters('.headline');
If you want to do so you should create a function that will execute that line, like so:
setInterval(function() {
$('#topt').inters('.headline');
}, 3000);
The above will call $('#topt').inters('.headline');
every 3 seconds.
Solution 2:
you need to do something in this way:
functionfoo(){
$("#topt").inters('.headline');
}
setInterval(foo,3000);
Post a Comment for "Setinterval And Function"