I’m using Drupal 7. I have page.tpl.php files and 5 menu items. And i want, change header image every menu. Be 1 img.
İs is possible via jQuery or another way?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I assume you want to change header image every page request- like rotating banners.
Easiest way- change location of img in your HTML to a PHP script, like this:
Then create myheader.php which will load image you want- each time different and serve it, like this:
This will serve images 0.png, 1.png, 2.png, 3.png, 4.png. If you have more images- change %5 to your value.
How does it work? It divides number of seconds since 01.01.1970 by 5 and returns reminder. So the reminder is always 0-4. So it serves images 0-4 + ‘.png’.
All your images must be PNG. If they are not- you need to alter “Content-type” header.