PDA

View Full Version : Mulitlpe Scripts?



pauldrans
08-27-2010, 12:58 PM
1) Script Title: Memory Ticker

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex2/memoryticker.htm

3) Describe problem:

Hello, I am trying to get 2 tickers on 1 webpage. Can you please tell me if this can be done? I have tried various ways, and got the second one to work, but would not change text. If anyone has managed to get this to work, I would be very greatful of a script where I can adjust. I would like to still be able to change the font size and obviously different text as well.

Thanks in advanced.

Paul D

vwphillips
08-27-2010, 04:52 PM
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title></title>
<style type="text/css">

#memoryticker{
background-color: lightyellow;
width: 450px;
font: bold 12px Verdana;
/*Tip: add in height attribute here for multiple line scroller*/
border: 1px solid black;
padding: 3px;
/*Change 0.7 below to a different number if desired (0.7=0.7 seconds)*/
/*Remove below line to remove transitional effect in IE. Below line should always appear last within this CSS*/
filter: progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.7)
}

#memoryticker1{
background-color: lightyellow;
width: 450px;
font: bold 12px Verdana;
/*Tip: add in height attribute here for multiple line scroller*/
border: 1px solid black;
padding: 3px;
/*Change 0.7 below to a different number if desired (0.7=0.7 seconds)*/
/*Remove below line to remove transitional effect in IE. Below line should always appear last within this CSS*/
filter: progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.7)
}

</style></head>

<body>
<div id="memoryticker" ></div>
<div id="memoryticker1" ></div>

<script type="text/javascript">
/*<![CDATA[*/

function Ticker(o){
this.obj=document.getElementById(o.ID);
this.nme=o.ID;
this.ms=o.tickdelay||3000;
this.ary=o.tickercontents;
this.cnt=0;
this.cng();
}

Ticker.prototype={

cng:function(){
if (this.obj.filters && this.obj.filters.length>0){
this.obj.filters[0].Apply()
}
this.obj.innerHTML=this.ary[this.cnt]
if (this.obj.filters && this.obj.filters.length>0){
this.obj.filters[0].Play()
}
this.cnt=(this.cnt==this.ary.length-1)? this.cnt=0 : this.cnt+1
var filterduration=(this.obj.filters&&this.obj.filters.length>0)? this.obj.filters[0].duration*1000 : 0
var oop=this;
setTimeout(function(){ oop.cng(); },this.ms+filterduration)
}
}


new Ticker({
ID:'memoryticker',
tickercontents:[
'1) <a href="http://www.javascriptkit.com">JavaScriptKit.com</a>- JavaScript tutorials and scripts.</a>',
'2) <a href="http://www.codingforums.com">Coding Forums</a>- Web coding and development forums.</a>',
'3) <a href="http://www.dynamicdrive.com">DynamicDrive.com</a>- Award winning, original DHTML scripts.</a>',
'4) <a href="http://www.freewarejava.com">FreewareJava</a>- Free Java applets, tutorials, and resources.</a>'
],
tickdelay:2000,
persistdays:1
});

new Ticker({
ID:'memoryticker1',
tickercontents:[
'1) <a href="http://www.javascriptkit.com">JavaScriptKit.com</a>- JavaScript tutorials and scripts.</a>',
'2) <a href="http://www.codingforums.com">Coding Forums</a>- Web coding and development forums.</a>',
'3) <a href="http://www.dynamicdrive.com">DynamicDrive.com</a>- Award winning, original DHTML scripts.</a>',
'4) <a href="http://www.freewarejava.com">FreewareJava</a>- Free Java applets, tutorials, and resources.</a>'
],
tickdelay:3000,
persistdays:1
});
/*]]>*/
</script>

</body>

</html>

I can add persistance if required