Live Chat Icon For mobile
Live Chat Icon

How can you make the text to scroll in the window’s status bar?

Platform: ASP.NET| Category: Client Side Scripting

The text can be made to scroll using the javascript codings as below.


<html>
	<head>
		<title> Scrolling  Text On Window Status Bar </title>
		<script language='javascript'>
		// Scrolling Status Bar
		var delay = 60;
		var message = 'Syncfusion - .Net Essentials';
		message += ' Text Scrolling  In Window Status Bar';
		var spaceslength = 130;
		var spaces = '';
		for (var c = 0; c < spaceslength; c++)
		spaces += ' ';

		function init() 
		{
			timer = setTimeout(’scroll(130)’, 500);
		}

		function scroll(position) 
		{
			var startMessage = '';
			var cmd = '';

			if (position > spaceslength)
			{
				position--;
				cmd = 'scroll(' + position + ')';	
				timer = setTimeout(cmd, delay);
			}
			else if (position <= spaceslength && position > 0)
			{
				startMessage = spaces.substring(0, position);
				startMessage += message;
				position--;
				cmd = 'scroll(' + position + ')';
				window.status = startMessage;
				timer = setTimeout(cmd, delay);
			}
			else if (position <= 0)
			{
				 if (-position < message.length)
				 {
					startMessage += message.substring(-position, message.length);
				      	startMessage += spaces.substring(0, spaces.length / 4);
					startMessage += message;
					 position--;
					 cmd = 'scroll(' + position + ')';
					  window.status = startMessage;	
					  timer = setTimeout(cmd, delay*3);
				}
				else
				{
					cmd = 'scroll(' + spaces.length / 4 + ')';
					timer = setTimeout(cmd, delay);
			 	}
			}
		}
		</script>
	</head>
	<body bgcolor='#ffffff' onLoad='init()'>
		<blockquote>
			<h4>JavaScript  Demonstration- Scrolling  Text On Window Status Bar</h4>
		</blockquote>
	<hr/> 
	</body>
</html>

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.