Mark Forums Read
  #1  
Old 04-13-2010, 08:47 AM
JavaScriptBank JavaScriptBank is offline
Senior Member
 
Join Date: Sep 2009
Posts: 130
JavaScriptBank is on a distinguished road
Default 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: Copy & Paste JavaScript code 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: Copy & Paste HTML code 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 -->





Reply With Quote
 #Add to Ads's Reputation  
OldSponsored Ads
Ads AdsPromoter is online
Member
 
Join Date: LongTime
Posts: 1100
Ads is on a distinguished road
Default New Sponsored Ads



This message will go away once you are registered. Also, by registering, you will have access to all post topics, communicate privately with other members (PM), respond to polls, upload graphics, and access other special features! Registration is fast, simple and absolutely free so please Click Here to join our Web Hosting community today!
Reply With Quote
  #2  
Old 05-14-2010, 06:20 AM
AndreClark99 AndreClark99 is offline
Junior Member
 
Join Date: May 2010
Posts: 3
AndreClark99 is on a distinguished road
Default

That one is that best script of AutoScroll DIV script.I also use this one and it works perfect for me without any issue.I appreciate you providing this script here.
__________________
Web Design New York
Reply With Quote
 #Add to Ads's Reputation  
OldSponsored Ads
Ads AdsPromoter is online
Member
 
Join Date: LongTime
Posts: 1100
Ads is on a distinguished road
Default New Sponsored Ads



This message will go away once you are registered. Also, by registering, you will have access to all post topics, communicate privately with other members (PM), respond to polls, upload graphics, and access other special features! Registration is fast, simple and absolutely free so please Click Here to join our Web Hosting community today!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 05:16 PM.


Powered by vBulletin Version 3.6.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 2.4.0