Marcy said:
Is there a way in FP to create a section of a page where new text is
displayed every few minutes? We want to have paragraphs about what
people are saying about our new product as it is being put into
production but want them to change and not be static. Can this be
done in FP and how. If not, how. Thanks
I found this script from A1 JavaScripts.
I havent quite figured out what all the code is for - some of it seems
unnecessary.
(For example this seems to do nothing:
onFocus="self.status='This is a JavaScript information data field';
return true"
onBlur="self.status=''; return true"
and it works OK when it is deleted)
There are two timers in the code:
timer = setTimeout("idleMsg()",1500); // 1.5 seconds
timer = setTimeout("idleMsg()",2500); // 1.5 seconds
I have tested it and altering 1500 to 0 loads the first message immediately,
which I guess you would want.
The other controls the time between each message, so change it to whatever
you want.
(Every 3 minutes would be 3*60*1000 = 180000.)
You may need a larger space to put the message, so perhaps change <input
type ="text" .......> to <input type ="textarea" rows="10" cols="72".......>
You then have a problem in entering the text of each para. and the code to
pad it out would be redundant or need altering.
Anyway this may give you some ideas. If you have difficulty, I can give it
more thought. One thought is an Iframe which is loaded with a new file every
x milliseconds (be it 2500 or 180000)
<html>
<head>
<!-- ===================================================
part 1 enter your messages in this part notices
= "Your message";
==================================================== -->
<script language="JavaScript">
var notices = new Array(
"A1 JavaScripts welcomes you to its website",
"Thank you for visiting, I hope you find what you are searching for",
"This is the example of the form text javascript.",
"Each message can be adjusted either in speed, or content",
"The length of the message box can also be personalized to fit your
needs.",
"More lines can be easily added to this script",
"Simply copy and paste the code into your page",
"Enjoy these scripts, and good luck with your site")
function update(msg)
{
var pad_str="";
n = msg.length;
if(n < 72)
{ pad = (73 - n) / 2;
for(var i = 0; i < pad; i++)
pad_str += " "; }
CurrentMsg = pad_str + msg;
document.messages.field.value = CurrentMsg;
clearTimeout(timer);
timer = setTimeout("idleMsg()",2500);
}
function nochange()
{ document.messages.field.value = CurrentMsg;}
function idleMsg()
{
update(notices[index++]);
if(index >= notices.length)
index = 0;
}
var index = 0;
var CurrentMsg = notices[0];
var timer = setTimeout('idleMsg()',1500);
</script>
</head>
<body>
<!--=========================================================
part 2 - put this where you want it to display
==========================================================-->
<center>
<font face="Helvetica">
<form name="messages" onSubmit="return false">
<input type="text" name="field" size=40 style="width:445" value=" "
onFocus="self.status='This is a JavaScript information data field';
return true"
onBlur="self.status=''; return true"
onChange="nochange()">
</form>
</font>
</center>
<!--======================================================-->
</body>
</html>