<p class="example">i want to split this paragraph into
words and fade them in one by one</p>
jquery/js:
$(document).ready(function() {
var $txt = $(".example")
,$words = $txt.text()
,$splitWords = $words.split(" ");
$txt.hide();
for(i = 0; i < $splitWords.length; i++){
// i want fade in each $splitWords[i]
//$splitWords[i].fadeIn(.... - i tried this doesnt work
}
});
我试图将段落拆分为单词,并将它们逐个淡化,这可能是一种更简单的方法来做到这一点而不拆分单词,请对此有所了解。谢谢