Jump to content

rotating image

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
Root23

Root23

    Programmer

  • Members
  • PipPipPipPip
  • 144 posts
Hi everyone,

I'm wanting to have a logo that changes on some sort of interval.. Either on every page load, or on a daily/weekly basis... Is this doable? Would I have to use something like Javascript? Or is there a better way?

I've never dealt with Javascript, but I'm thinking I could make create an array with the logo images.. then have it cycle through them somehow..

Thanks for any info..
Posted Image

#2
zoranh

zoranh

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 207 posts
Do you have server-side scripts in your webpage and in which language?

If you do have them, that is the location where to put image rotation.

If you do not, then you can place a client-side script (like Javascript) which sets image URL on page load, but that may leave bad impression on the visitor (image loads after the page is already rendered).

#3
Root23

Root23

    Programmer

  • Members
  • PipPipPipPip
  • 144 posts
Thanks for the tip about the javascript.

I'm not sure what scripts are available on the web server.. Currently I'm just developing on my desktop for someone.
Posted Image

#4
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
I am not sure, you can name your images 1 through 7 and cycle them each day of the week, I believe like this, I am not so sure of the syntax:
<script type="text/javascript">
var d=new Date();
document.write('<img src="' + d.getDay() + '.png"/>');
</script>

Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#5
Root23

Root23

    Programmer

  • Members
  • PipPipPipPip
  • 144 posts
I like that idea... I'll keep that in mind.
Posted Image