jquery hide all image but not the first

Sjmon picture Sjmon · Mar 5, 2011 · Viewed 9.5k times · Source

Hello all im trying to make this slide effect http://tinyurl.com/628z32d

but im new to jquery so i need a little help :), how can i hide all the big image in the #big-mage div and hide them? and then only show the first.

do you guys have a good simple to understand slide effect tutorial i will be glad to :)

Thanks!

this is what i have http://jsfiddle.net/bF9xy/

Answer

Mārtiņš Briedis picture Mārtiņš Briedis · Mar 5, 2011

Try like this:

$("div img").hide().filter(":first-child").show();

or use the $.not() to filter out unwanted elements:

$("img").not("img.class-not-to-select").hide();