Forum Moderators: open

Message Too Old, No Replies

Seeking Javascript that automatically updates text

need help

         

lwransom

12:21 am on Nov 22, 2007 (gmt 0)

10+ Year Member



Basically I have a limited knowledge of javascript and am attempting to put some javascript into my website myself. I have a daily fact that I update every day on my index page. What I am looking for is a javascript that would allow me to have that daily fact updated everytime somebody refreshes the page. It's almost always just a single sentence fact. Any advice or help would be greatly appreciated.

Kind Regards
Leo Ransom

daveVk

1:00 am on Nov 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



to have that daily fact updated everytime somebody refreshes the page

Are you implying there is a pool of "daily facts" and you wish the user to cycle thru them on refresh. Or that there is one fact per day.

lwransom

3:40 am on Nov 22, 2007 (gmt 0)

10+ Year Member



I have a pool of facts that I would cycle through.

daveVk

4:52 am on Nov 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As a first step I would include all the facts into page with only one visible something like

<span id='fact1' >Blah blah .. </span>
<span id='fact2' class='hideme'>Blah blah .. </span>
etc

with suitable css entry for 'hideme'

this way search engines will see all your facts

The job of the javascript is then to change the className of the choosen one to "" and the rest to "hideme"

Dabrowski

3:38 pm on Nov 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a script already written that will do this, it crossfades DIV's. Sticky me and I'll send it to you.