jdan / dynamo.js

Cycles through bits of text in place
http://jdan.github.io/dynamo.js/
MIT License
626 stars 65 forks source link

Simplified & optimized it a bit #6

Closed genesiscz closed 12 years ago

genesiscz commented 12 years ago

It all works now, http://jsfiddle.net/P7NkZ/9/

jdan commented 12 years ago

Found an issue with the width of the dynamo container: http://jsfiddle.net/P7NkZ/20/

I believe the culprit might be in these lines:

v.find('span').each(function(i, ele) {
    var s = $(ele).remove();
    var d = $('<div></div>').text(s.text());
    d.width(max);
    v.append(d);
});

Specifically with d.width and v.append(d) but I am unable to find an immediate fix.

genesiscz commented 12 years ago

Test: http://jsfiddle.net/Lka7f/2/

jdan commented 12 years ago

Bingo, thanks.