Solved

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

Posted on 2009-05-07
3
408 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
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…

746 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

9 Experts available now in Live!

Get 1:1 Help Now