Computer Geeks

Computer Geeks

Geek Shop

Geek News

Geek Stuff

Science Geek

Computer Gaming

Linux Chat

Building Websites

Computer Forums

Computer Help Forum

Computer Hardware Forum

Computer Software Programs


Go Back   Computer Forums > Building Websites
FAQ Community Calendar Today's Posts Search

Building Websites This section covers all aspects of publishing, developing and maintaining websites. Topics include: website design, graphic design, website programming, web hosting, website marketing (SEO, link exchange, publicity, advertising), monetization & etc.

Computer Geeks
» Active Discussions
Computer Geeks
No Threads to Display.
» Other Websites
- Software Publishing

- Server Hardening
Reply
 
Thread Tools Display Modes
  #1  
Old 04-13-2010, 04:46 AM
JavaScriptBank JavaScriptBank is offline
Senior Member
GB Guru
 
Join Date: Sep 2009
Posts: 180
Default Helpful JavaScripts to develop website

JavaScript codes for Web DEV

AutoScroll DIV script

Another script to create a auto scrolling message which move depend on scrollbars.... detail at JavaScriptBank.com - 2.000+ free JavaScript codes


How to setup

Step 1: Place JavaScript below in your HEAD section
JavaScript
Code:
<script type="text/javascript">
	
	var useWidth = "400px";
	var speed = 250 // greater is slower;

	var message = "Now is the time for all good men to come to the aid of their country. That's one small step for man, one giant leap for mankind. Ask not what your country can do for you, ask what you can do for your country. | ";

	// Remember to include the vertical bar | at the end of the message(s);

	var mContainer = "";
	var circleMsg = "";
	var prevMsg =  "";
	var useFloat = "";
	var xV = 0;
	var xL = 0;
	var msgLength = 0;
	
	function updateMessage(){
		
		if (circleMsg == ""){circleMsg = mContainer.lastChild.data}
		else {circleMsg = prevMsg}
		var separatorIdx = circleMsg.lastIndexOf('|');
		if (separatorIdx == -1){separatorIdx = msgLength}
		circleMsg = circleMsg.substring(1,separatorIdx);
		var spliceStr = message.substring(0,msgLength-separatorIdx-1);
		var dispMsg = circleMsg+spliceStr;
		mContainer.removeChild(mContainer.lastChild);
		mContainer.appendChild(document.createTextNode(dispMsg));
		prevMsg = circleMsg+'|'+spliceStr;
		setTimeout("updateMessage()",speed);
	}

	function startCrawl(){

		mContainer.appendChild(document.createTextNode(message))
		setTimeout("updateMessage()",3000);  // delay before crawl start;
	}

	function stayHome(){

		var nV = 0;
		var nL = 0;
		if(!document.body.scrollTop)
			{
			 nV = document.documentElement.scrollTop;
			 nL = document.documentElement.scrollLeft;
			}
		else	{
			 nV = document.body.scrollTop;
			 nL = document.body.scrollLeft;
			}
		if (nV == 0){window.scrollBy(0,1)}
		useFloat.style.top = nV+xV+"px";
		useFloat.style.left = nL+xL+"px";
		setTimeout("stayHome()",50);
	}

	window.onload=function(){

		mContainer = document.getElementById('crawl');
		document.getElementById('isFloat').style.width = useWidth;
		msgLength = message.length;
		useFloat = document.getElementById('isFloat');
		useFloat.style.left = ((screen.width-30)/2)-(parseInt(useWidth)/2)+"px";
		xV = useFloat.offsetTop;
		xL = useFloat.offsetLeft;
		stayHome();
		startCrawl();
	}

</script>
	<!--
    	This script downloaded from www.JavaScriptBank.com
    	Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
	-->
Step 2: Place HTML below in your BODY section
HTML
Code:
<Div id='isFloat' style='position:absolute;bottom:20px;overflow:hidden;height:28px;border:solid black 1px;font-size:14pt;background-color:lightyellow;color:darkblue'>

<Div id='crawl' style='padding:3px;white-space:nowrap'></Div>

</Div>
	<!--
    	This script downloaded from www.JavaScriptBank.com
    	Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
	-->





Javascript Music Player - Random Text Generator - Floating Image Script
Quote:
Originally Posted by Copyright
The Site may provide, or third parties may provide, links to non-JavaScriptBank.com Internet World Wide Web sites or resources. Because JavaScriptBank.com has no control over such sites and resources, you acknowledge and agree that JavaScriptBank.com is not responsible for the availability of such external sites or resources, and does not endorse and is not responsible or liable for any content, advertising, products, or other materials on or available from such sites or resources. You further acknowledge and agree that JavaScriptBank.com shall not be responsible or liable, directly or indirectly, for any damage or loss caused or alleged to be caused by or in connection with use of or reliance on any such content, goods or services available on or through any such site or resource.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Helpful JavaScripts to develop website JavaScriptBank Building Websites 0 03-12-2010 07:58 PM
Helpful JavaScripts to develop website JavaScriptBank Building Websites 0 03-04-2010 07:02 PM
Helpful JavaScripts to develop website JavaScriptBank Building Websites 0 12-30-2009 07:15 PM
Helpful JavaScripts to develop website JavaScriptBank Building Websites 0 12-07-2009 09:30 PM
Helpful JavaScripts to develop website JavaScriptBank Building Websites 1 12-03-2009 12:15 AM

Powered by vBadvanced CMPS v3.2.3

All times are GMT -5. The time now is 05:16 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
HTML Help provided by HTML Help Central.