Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / rotate header background image...

rotate header background image...

Locked

Views: 4,353

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
18 Jan 2008, 2:56 AM
#1
gorie avatar

gorie

New Zenner

Join Date:
Jan 2008
Posts:
89
Plugin Contributions:
0

rotate header background image...

i need some help.

here is my store as it is right now:
http://www.idyemyhair.com/store

what i would really like to do, is get an image rotater working for the header background image will be random every time someone visits / refreshes the page (but not animated).

so that one time coming to the page, it might be

another time it might be

or

i know there are php rotater scripts to do this, i am just not sure how to make it work with zen cart...

right now the background image is called in the stylesheet

#logoWrapper{
background-color: #ffffff;
background-image: url(../images/logo_random/logobg_magenta.png);
background-repeat: repeat-x;
height: 133px;
}

can someone please help with this???

18 Jan 2008, 5:12 AM
#2
gorie avatar

gorie

New Zenner

Join Date:
Jan 2008
Posts:
89
Plugin Contributions:
0

Re: rotate header background image...

ok nevermind !! i finally got it working... it wasn't recognizing my rotate.php where i had it for some reason even though i checked the path a million times... just wasn't liking it in that folder for some reason, but i moved it to a different folder and then it worked...

if anyone is wondering how to do this here is what i did...

download this script for rotating images ...
http://www.alistapart.com/d/randomizer/rotate.txt

save that as rotate.php and upload it into in an image folder , with only the images you want to rotate...

then in the stylesheet.css
#logoWrapper{
background: url(path/to/your/image/folder/you/want/to/rotate/rotate.php) no-repeat;
}

:)

check it out, i've got it working on my store now
http://www.idyemyhair.com/store

if you hit refresh a few times you'll see that the logo background changes color!!! yay. :D :D :D

25 Jul 2009, 1:37 AM
#3
r_nato avatar

r_nato

New Zenner

Join Date:
Aug 2008
Posts:
41
Plugin Contributions:
0

Re: rotate header background image...

I'd like to add the following:

  1. This .php script does not rotate the images while the site visitor is viewing the page; it simply selects a random image to display each time the page is loaded.
  2. To make this work, I had to create an .htaccess file for the folder in which I put the rotating images. Security-wise, I'm not sure if it is a smart thing to allow .php scripts to run from this folder, when they are clearly not meant to. Caveat Emptor.