[jQuery] Alternatives to dom ready() for running Jquery code
Hey all, I've ran into a problem where I get code that runs
occasionally on IE6 and IE7. It's working fine in Firefox, of
course :/
The code I have is:
$(document).ready(function(){
//$(function()
headline_count = $("div.headline").size();
$("div.headline:eq("+current_headline+")").css('top','5px');
headline_interval = setInterval(headline_rotate,9000); //time in
milliseconds
$('#scrollup').hover(function() {
clearInterval(headline_interval);
}, function() {
headline_interval = setInterval(headline_rotate,9000); //time in
milliseconds
headline_rotate();
});
function headline_rotate() {
current_headline = (old_headline + 1) % headline_count;
$("div.headline:eq(" + old_headline + ")").animate({top:
-205},"slow", function() {
$(this).css('top','210px');
});
$("div.headline:eq(" + current_headline + ")").show().animate({top:
5},"slow");
old_headline = current_headline;
}
// End of headline code
});
but I guess the important part is:
$(document).ready(function(){ .... });
Ready just doesn't seem to fire correctly for me all the time.
Looking at a previous post which kind of covered this :
http://groups.google.com/group/jquery-en/browse_thread/thread/ae511652b94433fa/819f718c882c9ba2?lnk=gst&q=ready()#819f718c882c9ba2
They couldn't get a definate answer neither.
I just want to ensure that the headlines do appear all the time, at
the moment I'm left with a white box sometimes.
live link to test is:
http://cressaid.brettjamesonline.com/bvci/