kfuzaylov / FastJs

The Fastest Javascript Framework
48 stars 3 forks source link

f.toggleClass & f.addClass are misbehaving with > 1 target elements #9

Open heavensrevenge opened 10 years ago

heavensrevenge commented 10 years ago

The f.toggleClass method is not only slow but also buggy/misbehaving. http://jsperf.com/tt-js-add-class/15 will show you it's speed vs the others, also if you look it exibits odd behavour and doesn't actually toggle when there is more than 1 element being targeted. Targeting a single element to toggle the class seems to work OK though. The behaviour of .addClass is similar and works weird with multiple targets just as toggleClass behaves.