How to create multiple instances?
Creating multiple instances is a piece of cake.
You must declare multiple CSS ids:
#ajaxticker {
width:200px;
height:130px;
border:1px solid black;
padding:5px;
background-color:#fefeea;
background-color:#F0F8FF;
font-family:verdana;
font-size:12px;
}
#ajaxticker2{
margin:5px;
width:500px;
height:100px;
border:1px solid black;
padding:5px;
background-color:#fefeea;
font-family:verdana;
font-size:12px;
}
and then simply create 2 instances for the 2 CSS IDs:
<script src="ajaxticker.js" type="text/javascript">
</script>
<!--
include this portion of code where you want to show ticker
-->
<script type="text/javascript">
var xmlfile="news.php";
var xmlfile2="news2.php";
new showTicker(xmlfile, "ajaxticker", "tickerclass", 4000, "fade");
new showTicker(xmlfile2, "ajaxticker2", "tickerclass2", 4000, "fade");
</script>