Hi to all, i need a code in Jquery for hide all images on all pages except the 'reCaptcha' thing. The images of reCaptcha start with the link: 'google.com/recaptcha' or 'recaptcha.net' ... My idea is to make the script that hide all images but not touch the images that contains the part 'recaptcha'. Is possible to make in Jquery? Thanks in advance and to all. Kind Regards. Luca.
+1
A:
First run $("img").hide();
then simply put an ID on the captcha tag and run $("#ID").show();
Or if you can't use an ID tag, cycle through all images in a loop and check what's in the src attribute, or even use a regex selector.
I have diffrent image id,tag,... Is possible to hide all site and then i show my interested with the command $("#ID").show(); ? Thanks again.
Luca
2010-09-13 16:50:16
Tatu has a better solution, I would use that one if I were you. His/Hers does not use use ID tags, it works on the value of the recaptcha src attribute.
2010-09-13 19:58:19
Thanks to all for help :-) But i use your solution becasue is the only that work in my script :-)
Luca
2010-09-15 18:48:46
"Something like this?" is not the question. The answer though, is Yes.
Here Be Wolves
2010-09-13 14:36:46
I have diffrent image id,tag,... Is possible to hide all site and then i show my interested with the command $("#ID").show(); ? Thanks again.
Luca
2010-09-13 16:49:19
A:
The ReCaptcha script puts all of its generated markup within a <div id="recaptcha_widget_div">
Having said that, you can grab all images except those within this DIV like this...
$("img:not(#recaptcha_widget_div img)").hide();
Or if that is too ugly, you can hide all images and re-show the ReCaptcha ones like this...
$("img").hide();
$("#recaptcha_widget_div img").show();
Josh Stodola
2010-09-13 20:05:08