The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Your best snippets Reply To: Your best snippets


Let me give that a virtual thumbs up for neatness, as to not clutter the thread with green banners. And then add this feature test for transition support I’ve recently fiddled together. It will also select the correct event to use for transitionend.

var pulse = 'TransitionEvent' in window ? 'transitionend' : 'WebKitTransitionEvent' in window ? 'webkitTransitionEnd' : '';


if (pulse) {

target.addEventListener(pulse, function() {

    // do stuff on transitionend

Slideshow demo

I think it’s valid to use these days but slightly discriminates against early versions of Opera.