这样的事情怎么样:jsFiddle例子.
jQuery的:
var string = $('h2').text();
var letters = string.split('');
var x = string.length;
$('h2').text('');
$.each(letters, function(index) {
$('h2').append('<span id="e' + index + '" class="normal">' + letters[index] + '</span>');
});
function Animate(elem) {
setTimeout(function() {
$('#e'+elem).animate({
'color': 'yellow'
}, 500, function(){elem++;Animate(elem)});
}, 50);
}
$('h2').mouseenter(function() {
Animate('0');
}).mouseleave(function() {});
Run Code Online (Sandbox Code Playgroud)
HTML:
<h2>OWEN MELBOURNE</h2>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2825 次 |
| 最近记录: |