On 18/09/06, Fil <[EMAIL PROTECTED]> wrote:
> > Just for the record, when I view this page in IE:
> > http://www.jquery.info/IMG/html/19_typewriter.html
> > nothing happens.
>
> You're right, it doesn't work at all on MSIE.
>
> > Surprisingly it also behaves badly in FF for the PC. It at least tries to
> > type itself out, but has some issuies when it gets to the word text.
>
> This is the same on all platforms: it's treating the content char by char,
> and shows the "<" of the "<i>" tag...
>
> -- Fil
A regular expression is probably the best thing to use. This is nearly
working (but not quite)
typeone = function(self, delay, text, content) {
var next;
if (text.length > 0) {
next = text.match(/(\s?(<[^>]*>)?\s?(&[^&]*;|[^<]))/)[0];
text = text.substr(next.length);
content = content+next;
$(self)
.html(content+'<span style="visibility:hidden">'+text+'<'+'/span>');
setTimeout(function(){
typeone(self, delay, text, content);
}, delay);
}
}
The reason I think it doesn't work is that there is a open tag without
its matching closing tag.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/