VB icon

CIRCULATING TEXT

Email
Submitted on: 1/5/2015 5:12:00 PM
By: DOSpoweredGEEK (from psc cd)  
Level: Advanced
User Rating: By 3 Users
Compatibility: HTML
Views: 539
 
     This feature circulates text in the top right corner of your web page.
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
'**************************************
' Name: CIRCULATING TEXT
' Description:This feature circulates text in the top right corner of your web page.
' By: DOSpoweredGEEK (from psc cd)
'**************************************

<!-- Paste in head -->
<script language="JavaScript">
if (document.all){
msg="Your message goes here ";
msgColor="00ff00";
msgFont="Verdana";//Some fonts work better than others, Verdana is smoothest!
//Nothing needs altering below!
msg=msg.split('');
n=msg.length; 
e=360/n;
yp=0;
xp=0;
yb=40;
xb=60;
sa=0.07;
sb=0;
pa=new Array();
pb=new Array();
for (i=0; i < n; i++){
document.write('<div id="logo" style="position:absolute;top:0;left:0;'
+'height:30;width:30;font-family:'+msgFont+';text-align:center;color:'+msgColor+'">'+msg[i]+'</div>');
}
function ani(){
yp=document.body.scrollTop+50;
xp=document.body.scrollLeft+window.document.body.clientWidth-100;
for (i=0; i < n; i++){
logo[i].style.top =yp+yb*Math.sin(sb+i*e*Math.PI/180);
logo[i].style.left=xp+xb*Math.cos(sb+i*e*Math.PI/180);
pb[i]=logo[i].style.pixelTop-yp;
pa[i]=pb[i]-pb[i]*2;
if (pa[i] < 1){
pa[i]=0;
logo[i].style.visibility='hidden';
}
else logo[i].style.visibility='visible';
logo[i].style.fontSize=pa[i]/2.7;
}
sb-=sa;
setTimeout('ani()',10);
}
window.onload=ani;
}
</script>


Other 1 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.