Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2008
    Posts
    93
    Plugin Contributions
    0

    Default 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???

  2. #2
    Join Date
    Jan 2008
    Posts
    93
    Plugin Contributions
    0

    Default 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.

  3. #3
    Join Date
    Aug 2008
    Posts
    41
    Plugin Contributions
    0

    Default 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.

 

 

Similar Threads

  1. v150 How to randomly rotate header background image on refresh?
    By scott_ease in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 2 Jul 2015, 01:07 PM
  2. Header background image
    By idler in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 15 Dec 2007, 10:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg