Jump to content

how to make a billboard


jwk811

Recommended Posts

thorpe he is looking for a text rotator.

jwk811 what you are looking for is a combination of JavaScript, possible mixed with PHP and if done  dynamically without refreshing the rest of the page, what it is referred to is AJAX (Asynchronous JavaScript and XML).

now what you need to decide is the next step, are the paragraphs you want to rotate, going to be all loaded when the page opens or do you want to load a different paragraph every few seconds?
Link to comment
Share on other sites

A working example:
[code]<html>
<head>

<script>

var ratateSeconds = 10;

paragraphs = new Array();
paragraphs[0] = "Paragraph One";
paragraphs[1] = "Paragraph Two";
paragraphs[2] = "Paragraph Three";
paragraphs[3] = "Paragraph Four";
paragraphs[4] = "Paragraph Five";
paragraphs[5] = "Paragraph Six";
paragraphs[6] = "Paragraph Seven";
paragraphs[7] = "Paragraph Eight";
paragraphs[8] = "Paragraph Nine";
paragraphs[9] = "Paragraph Ten";
var paraIndex = 0;

function rotatePara() {
  document.getElementById('paraDiv').innerHTML = paragraphs[paraIndex];
  paraIndex++
  if (paraIndex>=paragraphs.length) { paraIndex=0; }
  setTimeout('rotatePara()', ratateSeconds*1000)
}

</script>

</head>

<body onLoad="rotatePara();">

<div id="paraDiv"></div>

</body>
</html>[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.