Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery hide all image but not the first

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/

like image 815
Sjmon Avatar asked Mar 05 '11 22:03

Sjmon


2 Answers

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();
like image 114
Mārtiņš Briedis Avatar answered Oct 19 '22 20:10

Mārtiņš Briedis


try this code:

$("img:gt(0)").hide();
like image 3
DrStrangeLove Avatar answered Oct 19 '22 19:10

DrStrangeLove