Wilto / Dynamic-Carousel

A carousel plugin built for responsive layouts. There are many like it, but this one is mine.
matmarquis.com/carousel/
472 stars 112 forks source link

[BUG] Single list item triggers "Uncaught TypeError" #65

Open BlendedByUs opened 12 years ago

BlendedByUs commented 12 years ago

Line 7

var oPercent = this.attr('style').match(/margin\-left:(.*[0-9])/i) && parseInt(RegExp.$1, 10);

Seems to return... Uncaught TypeError: Cannot call method 'match' of undefined.

If only one list item is present.

BlendedByUs commented 12 years ago

Wrapping my code with if .size() > 1 seems to fix this issue but there should be sanity checking I guess in the plugin.

Thanks!