...

View Full Version : scrolling message in status bar



stevenmiller74
02-22-2007, 01:27 AM
Hi,

I am trying to find a code that will allow me to put random messages (one at a time, and NOT ongoing)...I want it to scroll once, and then stop in the lower left corner of the status bar. If my site visitors "refresh" the page, it should generate a different message.

I have been able to find ones that put all the messages together one after another, but I just want one message at a time. That way, they can get a different message each time they visit my site.

So, I'm looking for a script that allows for multiple messages, that would be put in the status bar in a random order, but will only give one message at a time, and will only scroll once and stop. Then the next time they visit (or if they refresh the page), they will get a different message.

Can you please help me? Any help is greatly appreciated :)

Steve




Here's the code I'm putting between the HEAD tags:

<script type="text/javascript">
<!--
/*
Script for scrolling the statusbar text
*/

/*** Configurable Section ***/
// Speed of scrolling
var SS_Delay = 80;
// Position to start scrolling
var SS_SPos = 100;
// Whether or not to display messages in random order
var SS_Random = false;
// Messages to scroll
var SS_ArMsg = new Array(
'This is line 1',
'This is line 2',
'This is line 3',
'This is line 4'
);
/*** No need to edit below this ***/
var SS_Timer = null;
var SS_Pos = -1;
var SS_Msg = "";
var SS_MsgId = -1;
var SS_MsgLen = SS_ArMsg.length;

// Start Scrolling
function SS_Start(){
if(SS_Timer)clearTimeout(SS_Timer);
SS_Scroll();
}
// Function for performing scroll
function SS_Scroll(){
if(SS_Pos <= SS_Msg.length){
self.status = SS_Msg.substring(SS_Pos, SS_Pos + SS_SPos);
}else{
SS_NextMsg();
SS_Pos = -1;
}
SS_Pos++;
SS_Timer = self.setTimeout("SS_Scroll()", SS_Delay);
}
// Get the Next Message for scrolling
function SS_NextMsg(){
if(SS_Random){
SS_MsgId = parseInt(Math.random() * SS_MsgLen);
}else{
SS_MsgId = (++SS_MsgId >= SS_MsgLen) ? 0 : SS_MsgId;
}
SS_Msg = SS_ArMsg[SS_MsgId];
// Prepend the string with space to match the
// specified starting position
for(var i = 0; i < SS_SPos; i++){
SS_Msg = " " + SS_Msg;
}
}

// Start Scrolling
SS_Start();
//-->
</script>

stevenmiller74
02-22-2007, 04:27 AM
Anybody? Please help me with this...thanks :-)

felgall
02-22-2007, 06:15 AM
Modern browsers don't allow Javascript to update the status bar and so the only effect that such scripts have these days is to slow down your page loading in the browser.

stevenmiller74
02-22-2007, 03:03 PM
It works fine in my IE7 browser, so I disagree. I just need it to stop scrolling. You apparently didn't read my complete thread. Read it again and see if you can assist :)

Arty Effem
02-23-2007, 04:31 AM
So, I'm looking for a script that allows for multiple messages, that would be put in the status bar in a random order, but will only give one message at a time, and will only scroll once and stop. Then the next time they visit (or if they refresh the page), they will get a different message.


I think this should fit the bill: Link (http://www.hotspot.freeserve.co.uk/scripterlative/?scrollstatus)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum