Grow your CSS skills. Land your dream job.

[Solved] Recommend a Plugin for Image Rotator?

  • # November 20, 2009 at 10:12 pm

    Hi all,

    I’m curious which plug-in you all would use to load a new image each time a page is visited. A sample of what I’m looking for is here http://www.joemcnally.com/blog/

    A new image loads at the very top of the page each time the page is reloaded. I’m looking for the most simple method of accomplishing this. If the images were selected randomly from a folder that would be sweet!

    Any input appreciated.

    Thanks,

    jr

    # November 20, 2009 at 11:57 pm

    I just do it manually…

    I name all the images with the same name and a different number 1-10, then say:

    /images/imgname<?= rand(1,10) ?>.jpg

    I’m pretty sure that’s right…

    # November 21, 2009 at 3:16 pm

    That’s a good option. I could change images without changing code. That is my real goal. To allow a client to update the images used in the rotator without having to adjust any code.

    Anyone have any other options that they use for this scenario?

    # November 22, 2009 at 5:26 pm

    I’m not able to get <?= rand(1,3) ?> to work.

    I’ve tried searching for the correct syntax but I’m not finding an answer. Any suggestions?

    Here is the code I’m using:

    Code:
    # November 23, 2009 at 2:58 am

    Hmmm

    My first guess is that your server doesn’t allow short hand. Try this:

    Code:
    Rob
    # November 23, 2009 at 4:26 am

    My thought was exactly the same as Mr Sanders :)

    <? is shorthand for <?php – but a lot of servers do not support it by default.

    # November 23, 2009 at 9:54 am

    Thanks!

    I had tried <?php… but forgot to add "echo". I’m still getting the hang of php. The code works perfectly now.

    Thanks again,

    jr

    # November 23, 2009 at 1:32 pm

    Excellent [img]http://www.websitesinaflash.com/images/thumbsup.gif[/img]

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".