Using jQuery it's possible with little tweak: http://jsfiddle.net/yahavbr/EbNh7/
JS in use:
var _text = "";
$(document).ready(function() {
_text = $("#myDiv").text();
StrikeThrough(0);
});
function StrikeThrough(index) {
if (index >= _text.length)
return false;
var sToStrike = _text.substr(0, index + 1);
var sAfter = (index < (_text.length - 1)) ? _text.substr(index + 1, _text.length - index) : "";
$("#myDiv").html("<strike>" + sToStrike + "</strike>" + sAfter);
window.setTimeout(function() {
StrikeThrough(index + 1);
}, 100);
}
This will strike through myDiv
text, making the line appear with animation.
As it's not using any heavy jQuery stuff it can be converted to plain JavaScript pretty easily so if you prefer not to use jQuery I'll edit my answer.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…