Image Randomizer
-
Hi Lay-Theme Team,
I'm currently thinking about a way to randomize certain images on my (still wip) site. The most comfortable way would be a plugin.
The exact area I wanted to use it at would be for the logo in the header of my site. I’d like to be able to define n images / logos to randomly show up where the logo is placed in the headerbar.
The coolest thing would be to even define that the images are randomly chosen per session. But it would totally fine to have it change with every browser refresh.Is there any easy way to do so?
Or is this more like a custom-plugin?If it’s the latter could you point me in a direction what needs to be done?
Cheers!
-
Dear @edgrbnz
you can do this with jQuery. It won't be that difficult.
If you don't know how to code jQuery – I think it will be rather difficult. A plugin won't help you I think.But have a look into jQuery. It's fun ;-)
Marius
-
@mariusjopen Any resources you’d recommend to have a look at?
-
Dear @edgrbnz
a basic course in Codeacademy about jQuery is a good start.
Otherwise google this like this: jquery random imageYou can find some examples also in jsFiddle I suppose.
Keep this in mind though:
http://laytheme.com/documentation.html#custom-javascriptBest!
Marius
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"
This often solves issues you might run into
When you post:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it