Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I thought this would be a simple things to do, but been searching about an hour...

I'm trying to use jquery fadein for all images on a WP site.

I've got as far as loading jquery

but then all the things I find online are really complex, is there a simples .js I can load to apply fadein unilaterally to any image loaded?

update: I've worked around the problem: by ditching the WP enqueue and going with the google url. so the problem here is WP specific

share|improve this question
Close-voted as off-topic. This is a jQuery question that isn't specific to WordPress. (i.e. you're essentially asking, "how do I apply jQuery fadein to all images on a page.) – Chip Bennett Aug 22 '12 at 20:32
well no, I'm asking how to apply it within WP – bracketboy Aug 22 '12 at 20:34
Please expound upon "apply it within WP". Do you have a specific script that you're trying to enqueue? – Chip Bennett Aug 22 '12 at 21:18
1  
There's little reason to consider this as anything more than a jquery question, since html is just html – Tom J Nowell Aug 22 '12 at 21:22
For reference $('img').hide().fadeIn(); – Tom J Nowell Aug 22 '12 at 21:23
show 2 more comments

closed as off topic by Chip Bennett, Tom J Nowell, Stephen Harris, Wyck, Brian Fegter Aug 31 '12 at 4:07

Questions on WordPress Answers are expected to relate to WordPress within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

2 Answers

First things First ... jQuery is already part of WordPress ... but you could just add the Use Google Libraries plugin to have the latest / best version of jQuery ... and as it's hosted by Google it saves on some space / data transfer.

Then essentially you just need to find a jQuery Script (so this is now really off topic and I agree with Chip here) to do what you want it to and modify your theme files

Have you gone to wordpress.org/extend/plugins ? and had a look for image effect plugins

If you find a plugin or get stuck on how to include some js in your theme then come back here and ask a new question stating what you have tried to do and why it failed :)

share|improve this answer
a plugin? for something that on the face of it should be so simple? – bracketboy Aug 23 '12 at 7:11
adding a plugin for this is such a bloated and bad idea. the solution only needed one line of code. – bracketboy Aug 23 '12 at 8:57
depends on your skills and knowledge ... as i said ... if you know or want to modify your theme. – Damien Aug 23 '12 at 18:49

Can you not simply hide all images in the CSS, using the content ID or Class as start point (so you dont hide logo or structural images etc) i.e. #content img { display:none; }

Then simple JQuery on load:

$('#content > img').fadeIn();

As long as you dont need it to be any more sophisticated a simple script like this should be plenty?

If you want them to fadeIn as they are displayed (once they are within the viewport) then you may need to get a little more complex.

share|improve this answer
thanks for the answer, that is more or less what I did. – bracketboy Aug 23 '12 at 10:52

Not the answer you're looking for? Browse other questions tagged or ask your own question.