Solved

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

Posted on 2009-05-07
3
412 Views
Last Modified: 2012-05-06
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
0
Comment
Question by:23-degrees
  • 3
3 Comments
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 125 total points
ID: 24334162
http://vbarsan.com/multiplescroller.htm

seems to be the basis for what they use
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 24334174
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 24334215
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

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
jQuery Menu mouseout 8 294
Save user setting in html 3 181
Alternate Div background color 4 69
Drag and drop columns in Wordpress WPDataTables 9 177
When converting a physical machine to a virtual machine using VMware vCenter Converter Standalone or vCenter Converter Enterprise, if an adapter type is not selected during the initial customization the resulting virtual machine may contain an IDE d…
Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

937 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now