A tweet-sized slideshow and DOM show/hide iteration utility.
- Shows/Hides a collection of DOM-elements with a certain interval
- Interval delay can be set in ms
- Index where the slideshow should start can be set
See examples below in test.html. The example uses JS 1.6 filter function, so don't expect it to run in IE<9.
IMPORTANT NOTICE: you shouldn't actually use this god-awful (wonderfully geeky rainbow) piece of crap code. Always prefer JSlinted, well formed and secure code over unstable, hard-to-read error-prone ninja code.
@tsaniel, wow, down to 115 bytes and still works. Can you explain why? I don't understand why adding
~
in front offunction
makes a difference.I thought about using the remaining bytes for an opacity transition effect but transition support is insanely broken in Firefox (I start to think that Firefox becomes the new Internet Explorer, also see the problems I had with my dumpGlobalLeaks). It kind of works in Opera when adding some CSS like
* { -o-transition: all .4s; }
.