jquery hide all image but not the first
Asked Answered
U

3

6

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/

Untuck answered 5/3, 2011 at 22:15 Comment(1)
Please remove the make tag - your question has nothing to do with the make program.Fatuity
W
10

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();
Whereat answered 5/3, 2011 at 22:18 Comment(4)
i think i should use the :firstUntuck
$("div img").hide().filter(":first-child").show(); this works but it hide all the big image and only show the first small image :d i have try target it with $('#big-image img') but dident workUntuck
ups i have hide the div in my CSS :DUntuck
This works $("#big-image img").hide().filter(":first-child").show(); Thanks :DUntuck
D
3

try this code:

$("img:gt(0)").hide();
Decembrist answered 5/3, 2011 at 22:23 Comment(0)
L
3
$("div#big-mage img:not(:first)").hide();
Lemaster answered 5/3, 2011 at 22:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.