Link to home
Start Free TrialLog in
Avatar of 23-degrees
23-degreesFlag for United States of America

asked on

I need a nice javascript vertical news scroller with stay feature.

Hi, I need a nice vertical javascript news scroller (some thing similar to www.asdha.org). This scroller should display two news at a time and should stay for few seconds before sliding in next two news. Please refer to some light weight script because i'm already using 2-3, javascript features on this asp.net page.
Thanks
ASKER CERTIFIED SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Here
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
window.onload=start;
 
/* the code was taken from  www.asdha.org but seems to come from 
*Vertical Scroller
*Made available by  http://www.anandsoft.com
*Written by G.Naresh
*The above information may not be removed  ..For help please email: info@anandsoft.com
 
Or taken from http://vbarsan.com/multiplescroller.htm
 
*/
 
var swidth=200;
var sheight=420;
var sspeed=12;  
var restart=sspeed;
var rspeed=sspeed;
var spause=7000;
var sbcolor="#";  
var singletext=new Array();
singletext[0]=' The ASDHA 32nd Annual House of Delegates will be held October 23rd and 24th -- 10/23/2009 <div onclick=window.location="News.aspx?Id=8" style="cursor: hand;" align=right>More ... </div> <br /> ASDHAs Annual Scientific Conference is August 21 - 23, 2009 at the Wig Wam Resort & Spa  -- 8/21/2009 <div onclick=window.location="News.aspx?Id=6" style="cursor: hand;" align=right>More ... </div> '; 
singletext[1]=' ASDHAs Annual Scientific Conference is August 21 - 23, 2009 at the Wig Wam Resort & Spa  -- 8/21/2009 <div onclick=window.location="News.aspx?Id=6" style="cursor: hand;" align=right>More ... </div> <br /> Affiliated Practice Clinic Opens in East Valley -- 2/8/2009 <div onclick=window.location="News.aspx?Id=29" style="cursor: hand;" align=right>More ... </div> '; 
var ii=0;
function goup(){if(sspeed!=rspeed*16){sspeed=sspeed*2;restart=sspeed;}}
function godown(){if(sspeed>rspeed){sspeed=sspeed/2;restart=sspeed;}}
function start(){
if(document.getElementById){ns6div=document.getElementById('iens6div');ns6div.style.top=sheight;ns6div.innerHTML=singletext[0];sizeup=ns6div.offsetHeight;ns6scroll();}
else 
if(document.layers){ns4layer=document.ns4div.document.ns4div1;ns4layer.top=sheight;ns4layer.document.write(singletext[0]);ns4layer.document.close();sizeup=ns4layer.document.height;ns4scroll();}
else 
if(document.all){iediv=iens6div;iediv.style.pixelTop=sheight;iediv.innerHTML=singletext[0];sizeup=iediv.offsetHeight;iescroll();}}
function iescroll(){if(iediv.style.pixelTop>0&&iediv.style.pixelTop<=sspeed){iediv.style.pixelTop=0;setTimeout("iescroll()",spause);}else 
if(iediv.style.pixelTop>=sizeup*-1){iediv.style.pixelTop-=sspeed;setTimeout("iescroll()",100);}else{if(ii==singletext.length-1)ii=0;else ii++;iediv.style.pixelTop=sheight;iediv.innerHTML=singletext[ii];sizeup=iediv.offsetHeight;iescroll();}}
function ns4scroll(){if(ns4layer.top>0&&ns4layer.top<=sspeed){ns4layer.top=0;setTimeout("ns4scroll()",spause);}else 
if(ns4layer.top>=sizeup*-1){ns4layer.top-=sspeed;setTimeout("ns4scroll()",100);}else{if(ii==singletext.length-1)ii=0;else ii++;ns4layer.top=sheight;ns4layer.document.write(singletext[ii]);ns4layer.document.close();sizeup=ns4layer.document.height;ns4scroll();}}
function ns6scroll(){if(parseInt(ns6div.style.top)>0&&parseInt(ns6div.style.top)<=sspeed){ns6div.style.top=0;setTimeout("ns6scroll()",spause);}else 
if(parseInt(ns6div.style.top)>=sizeup*-1){ns6div.style.top=parseInt(ns6div.style.top)-sspeed;setTimeout("ns6scroll()",100);}
else{if(ii==singletext.length-1)ii=0;else ii++;
ns6div.style.top=sheight;ns6div.innerHTML=singletext[ii];sizeup=ns6div.offsetHeight;ns6scroll();}}
</SCRIPT>
</head>
<body>
<script language="JavaScript">if(document.layers){document.write('<ilayer id="ns4div" width='+swidth+' height='+sheight+' bgcolor='+sbcolor+'><layer id="ns4div1" width='+swidth+' height='+sheight+' onmouseover="sspeed=0;" onmouseout="sspeed=restart"></layer></ilayer>')}
if(document.getElementById||document.all){document.write('<div style="position:relative;overflow:hidden;width:'+swidth+';height:'+sheight+';clip:rect(0 '+swidth+' '+sheight+' 0);background-color:'+sbcolor+';" onmouseover="sspeed=0;" onmouseout="sspeed=restart"><div id="iens6div" style="position:relative;width:'+swidth+';"></div></div>');}</script>
</body>

Open in new window