tags:

views:

23

answers:

3

i need to show all images, which are in the div with class="deep".

when i try the following script it doesn't work.

$(".deep img").css("visibility", "visible");

i can solve the problem using something like .each, but maybe there is something more simple?

Thanks

+1  A: 

If the images are visibility: hidden this will work. However, more often they're display:none, in which case do this:

$(".deep img").show();
Nick Craver
yes, they has `visibility: hidden` before script, but by so it doesn't work. i have many div's with `class="deep"`, and i need to apply to all images in all divs with `deep` class
Syom
@Syom - It will still work, jQuery executes the chain against *all* elements the selector matched, not just the first. There must be something else going on if your current code isn't doing this.
Nick Craver
A: 

What is the state of the images before you attempt the above line? Are they display:none?

redsquare
A: 

Try this. $('.deep').find('img').css("visibility", "visible");

Amit
That is what he has$('.deep img') is the same as $('.deep').find('img')
redsquare
ohh sorry my mistake,,,, thanks for pointing out
Amit