New Revised CSS Library Forums Web Tools
FAQs Awards Usage Terms Contact

<html>

<body>

<script language="JavaScript1.2">

//XML Ticker script- By Premshree Pillai (premshree@hotmail.com)
//http://www.qiksearch.com/
//Visit http://www.dynamicdrive.com for this script

var browserok=window.ActiveXObject
if (browserok)
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");

function loadXML(xmlFile)
{
xmlDoc.async="false";
xmlDoc.onreadystatechange=verify;
xmlDoc.load(xmlFile);
ticker=xmlDoc.documentElement;
}

function verify()

if (xmlDoc.readyState != 4)

return false; 
}
}

if (browserok){
loadXML('ticker_items.xml');

document.write('<style type="text\/css">');
document.write('.ticker_style{font-family:' + ticker.childNodes(1).childNodes(0).getAttribute('font') + '; font-size:' + ticker.childNodes(1).childNodes(0).getAttribute('size') + '; color:' + ticker.childNodes(1).childNodes(0).getAttribute('color') + '; font-weight:' + ticker.childNodes(1).childNodes(0).getAttribute('weight') + '; text-decoration:' + ticker.childNodes(1).childNodes(0).getAttribute('decoration') + '}');
document.write('.ticker_style:hover{font-family:' + ticker.childNodes(1).childNodes(1).getAttribute('font') + '; font-size:' + ticker.childNodes(1).childNodes(1).getAttribute('size') + '; color:' + ticker.childNodes(1).childNodes(1).getAttribute('color') + '; font-weight:' + ticker.childNodes(1).childNodes(1).getAttribute('weight') + '; text-decoration:' + ticker.childNodes(1).childNodes(1).getAttribute('decoration') + '}<br>');
document.write('</style>');

document.write('<table style="border:' + ticker.childNodes(0).getAttribute('border') + ' solid ' + ticker.childNodes(0).getAttribute('bordercolor') + '; background:' + ticker.childNodes(0).getAttribute('background') + '; width:' + ticker.childNodes(0).getAttribute('width') + '; height:' + ticker.childNodes(0).getAttribute('height') + '"><tr><td><div id="ticker_space"></div></td></tr></table>');

var item_count=2;
var timeOutVal=(ticker.childNodes(0).getAttribute('timeout'))*1000;
var original_timeOutVal=timeOutVal;
var isPauseContent;

if(ticker.childNodes(0).getAttribute('pause')=="true")
{
isPauseContent=' onmouseover="setDelay();" onmouseout="reset();"';
}
else
{
isPauseContent='';
}
}

function setTicker()
{
document.all.ticker_space.innerHTML='<center><a href="' + ticker.childNodes(item_count).getAttribute('URL') + '" target="' + ticker.childNodes(item_count).getAttribute('target') + '" class="ticker_style"' + isPauseContent + '>' + ticker.childNodes(item_count).firstChild.text + '</a></center>';
if(item_count==ticker.childNodes.length-1)
{
item_count=2;
}
else
{
item_count++;
}
setTimeout("setTicker()",timeOutVal);
}

function setDelay()
{
timeOutVal=10000000000000;
item_count--;
}

function reset()
{
timeOutVal=original_timeOutVal;
setTicker();
}

if (browserok)
setTicker();

</script>

</body>
</html>

<!--Source for ticker_items.xml-->

<?xml version="1.0" ?> 
<ticker>
<tickerstyle pause="false" timeout="1.5" border="2" bordercolor="#FF9900" background="#FFFFD5" width="350" height="30"></tickerstyle>
<tickerlinkstyle><mouseout font="verdana,arial,helvetica" color="#000000" decoration="none" weight="bold" size="8pt"></mouseout>
<mouseover font="verdana,arial,helvetica" color="#FF0000" decoration="underline" weight="bold" size="8pt"></mouseover>
</tickerlinkstyle>
<tickeritem URL="http://www.dynamicdrive.com" target="_top">Dynamic Drive</tickeritem>
<tickeritem URL="http://www.javascriptkit.com" target="_top">Click here for JavaScript Kit</tickeritem>
<tickeritem URL="http://www.freewarejava.com" target="_blank">Freewarejava.com- Java applets</tickeritem>
<tickeritem URL="http://www.qiksearch.com" target="_top">Qiksearch.com</tickeritem>
</ticker>