Forum Moderators: open

Message Too Old, No Replies

Display random links in a div

or <ul>

         

humpingdan

8:28 pm on Jan 21, 2004 (gmt 0)

10+ Year Member



I have this snippet of code below floating to the right on my new css page, what id like to be able to do is vary the content that appears in the below <ul> now i can place this in a div and have a number of divs set up so that they can interchange randomly with eahc other but i have a clue at how to do this?

<ul>
<li>
<h2>Top sites</h2>
<h3>My Current Favourites</h3>
<h3><a title="Widget" href="widget.com" target=_blank>widget</a></h3>
<p>description</p>

<h3><a title="Widget" href="widget.com" target=_blank>widget</a></h3>
<p>description</p>

<h3><a title="Widget" href="widget.com" target=_blank>widget</a></h3>
<p>description</p>

</li>
</ul>

basically serve up the above code each time but serve different links with there descriptions, maybe this is a php question, if so direct me there? basically any suggestions?

Thanks

Purple Martin

7:27 am on Jan 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could write some JavaScript to randomly change the content of the div by changing it's innerHTML property, BUT that wouldn't work for users who have turned off JavaScript. Therefore, a better solution would be to get php to do the job.