I already have separate auto refresh code and auto scroll code.
I want them to be in one function...How can I do that?
Here's my code for auto refresh
var auto_refresh = setInterval(function ()
{
$('#load_tweets').load('http://myayg.com/index.php?route=salesTracker2.results').fadeIn("slow");
}, 10000);
and my auto scroll
function scroll(speed) {
$('html, body').animate({ scrollTop: $(document).height() }, speed, function() {
$(this).animate({ scrollTop: 0 }, speed);
});
}
speed = 30000;
scroll(speed)
setInterval(function(){scroll(speed)}, speed * 2);
I want them in one script...How can I do that?