Hi, i wanted to know whats wrong with this coding as its making the browser crash, firefox 5
$(document).ready(function() {
/* open rel=external in new window */
$('a[rel=external]').attr('target', '_blank');
/*Scrolling background clouds */
var offset = 600;
var offseta = 1450;
function scrollbackground() {
// decrease the offset by 1, or if its less than 1 increase it by
// the background height minus 1
offset = offset + 1;
offseta = offseta + 1;
// apply the background position
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i)))
{
$('#cloud2').css("background-position", offseta + "px top");
}
else {
$('#cloud').css("background-position", offset + "px top");
$('#cloud2').css("background-position", offseta + "px top");
}
// call self to continue animation
setTimeout(function() {
scrollbackground();
}, 100
);
}
// Start the animation
scrollbackground();
}); //end
Comment