Quelqu'un sait-il pourquoi le code suivant ne fonctionne pas dans IE? (fonctionnant bien dans d'autres navigateurs)mot par l'animation d'affichage de texte ne fonctionne pas dans IE
div.hide().contents().each(function() {
var words;
if (this.nodeType === 3) {
words = '<span> ' + this.data.split(/\s+/).join(' </span><span> ') + ' </span>';
$(this).replaceWith(words);
} else if (this.nodeType === 1) {
this.innerHTML = '<span> ' + this.innerHTML.split(/\s+/).join(' </span><span> ') + ' </span>';
}
});
// Remove any empty spans that were added
div.find('span').hide().each(function() {
if(!$.trim(this.innerHTML)) {
$(this).remove();
}
});
div.show().find('span').each(function(i) {
$(this).css('filter', 'alpha(opacity=40)');
$(this).delay(400 * i).fadeIn(600);
});
Une solution de contournement pour que l'effet d'affichage mot à mot fonctionne dans IE?
EDIT:
créé un violon ici: http://jsfiddle.net/8dh3F/
Quelles erreurs obtenez-vous dans la console? Qu'est-ce qui ne fonctionne pas exactement? –
Je ne reçois aucune erreur. Le problème est que le texte ne s'affiche pas du tout! –
Remplacement fadeIn (600) avec fadeTo (1, 600) pourrait aider – Sem