textillate icon indicating copy to clipboard operation
textillate copied to clipboard

Syntax error, unrecognized expression: :nth-child in firefox

Open mircian opened this issue 11 years ago • 3 comments

Great plugin, in some situation it throws this error in firefox. For me the simple fix to this was changing line 143 var $elem = base.$texts.find(':nth-child(' + (index + 1) + ')') to var $elem = base.$texts.find(':nth-child(' + parseInt(index + 1) + ')') and also line 186 var $elem = base.$texts.find(':nth-child(' + (base.currentIndex + 1) + ')') to var $elem = base.$texts.find(':nth-child(' + parseInt(base.currentIndex + 1) + ')')

Not really breaking anything but because sometimes the variable was not seen as a integer it would throw this error which kept piling up in the console, the animation was in no way affected by this.

mircian avatar Oct 14 '14 09:10 mircian

Reproduced in Chrome also. And gripgrip's code doesn't help :(

e-oz avatar Oct 26 '14 20:10 e-oz

$elem.addClass('current');

"awesome" plugin, lol. Wash your code.

e-oz avatar Oct 26 '14 20:10 e-oz

PR to fix: https://github.com/jschr/textillate/pull/57

e-oz avatar Oct 26 '14 20:10 e-oz