так что у меня есть этот скрипт, который просто выводит и выводит теги p и циклически перебирает их.По какой-то причине, если я оставлю страницу открытой на некоторое время, они перестанут исчезать и просто начнут укладываться друг на друга.Это займет некоторое время, и я думаю, что это происходит только в Chrome.
$(document).ready(function(){
var current_quote = 0,
fade_interval = null,
num_quotes = $("#quotes p").length;
// Fade in the first quote.
$("#quote0").fadeIn(2500);
// Schedule for the inital fade out.
setTimeout(fadeQuotes, 6000);
function fadeQuotes() {
// Fade out the current quote.
$("#quote" + current_quote).fadeOut(2500, function() {
// Fade in the next quote.
current_quote = (current_quote + 1)
if(current_quote+1 > num_quotes)
{
current_quote=0;
}
current_quote = current_quote % num_quotes;
$("#quote" + current_quote).fadeIn(2500);
});
// Set the fading interval, if it's not already set.
if (fade_interval == null) {
fade_interval = setInterval(fadeQuotes, 13010);
}
}
});