XML Ticker (IE) : Ticker : GUI Components JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » GUI Components » Ticker »

 

XML Ticker (IE)



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>XML Ticker</title>
<style type="text/css">
.link{font-family:verdana,arial,helvetica; color:#003399; font-size:8pt; font-weight:bold}
.link:hover{font-family:verdana,arial,helvetica; color:#CC0000; font-size:8pt; font-weight:bold}
.link_xml{font-family:verdana,arial,helvetica; color:#003399; text-decoration:none; font-size:10pt; font-weight:bold}
.link_xml:hover{font-family:verdana,arial,helvetica; color:#FF9900; text-decoration:none; font-size:10pt; font-weight:bold}
</style>
</head>
<body bgcolor="#EFEFEF">

<table width="650" style="border:3 solid #000000; background:#FFFFFF" align="center"><tr><td>

<center><span style="font-family:verdana,arial,helvetica; font-size:40pt; color:#808080; font-weight:bold">XML Ticker</span></center>

</center>

<center><br>

<!--BEGIN XML TICKER BY PREMSHREE PILLAI-->
<script language="JavaScript1.2">

// XML Ticker JavaScript
// (c) 2002 Premshree Pillai
// http://www.qiksearch.com
// Use freely as long as all messages are as it is
// Location of script : http://www.qiksearch.com/javascripts/xml/ticker.htm

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
 }
}

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();
}

setTicker();

</script>
<!--END XML TICKER BY PREMSHREE PILLAI-->

</center><br>

<table width="600" align="center"><tr><td>
<font face="verdana,arial,helvetica" size="-1" color="#000000">
This is an XML based JavaScript Ticker that can tick any number of messages. The ticker works with <b>IE only</b>. The ticker reads it's contents, i.e the ticker style, text to be displayed, the link for that particular message from a XML file. (Here <a href="ticker_items.xml" class="link_xml" target="_blank">ticker_items.xml</a>). The structure of the XML document is as follows &raquo;
</font>
</td></tr></table><br>

<table align="center"><tr><td>
<font face="verdana,arial,helvetica" size="-1" color="#000000">

<b>TICKER</b><br>
<img src="section.gif" width="13" height="13"> tickerstyle<br>

<table cellspacing="0" cellpadding="0"><tr><td><table width="13" cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td><td><font face="verdana,arial,helvetica" size="-1" color="#CC0000">&nbsp;&raquo;&nbsp;pause = "true" "false" :: "true" for pause onMouseOver</font></td></tr></table>
<table cellspacing="0" cellpadding="0"><tr><td><table width="13" cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td><td><font face="verdana,arial,helvetica" size="-1" color="#CC0000">&nbsp;&raquo;&nbsp;timeout = any integer :: The delay in seconds between different messages.</font></td></tr></table>
<table cellspacing="0" cellpadding="0"><tr><td><table width="13" cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td><td><font face="verdana,arial,helvetica" size="-1" color="#CC0000">&nbsp;&raquo;&nbsp;border = any integer :: Border width of Ticker</font></td></tr></table>
<table cellspacing="0" cellpadding="0"><tr><td><table width="13" cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td><td><font face="verdana,arial,helvetica" size="-1" color="#CC0000">&nbsp;&raquo;&nbsp;bordercolor = #HexColor :: The border color of Ticker</font></td></tr></table>
<table cellspacing="0" cellpadding="0"><tr><td><table width="13" cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td><td><font face="verdana,arial,helvetica" size="-1" color="#CC0000">&nbsp;&raquo;&nbsp;background = #HexColor :: Background color of Ticker</font></td></tr></table>
<table cellspacing="0" cellpadding="0"><tr><td><table width="13" cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td><td><font face="verdana,arial,helvetica" size="-1" color="#CC0000">&nbsp;&raquo;&nbsp;width = any integer :: Ticker width</font></td></tr></table>
<table cellspacing="0" cellpadding="0"><tr><td><table width="13" cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td><td><font face="verdana,arial,helvetica" size="-1" color="#CC0000">&nbsp;&raquo;&nbsp;height = any integer :: Ticker height</font></td></tr></table>
<img src="section.gif" width="13" height="13"> tickerlinkstyle<br>

<table cellspacing="0" cellpadding="0"><tr><td><table width="13" cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td><td><font face="verdana,arial,helvetica" size="-1" color="#003399">&nbsp;<img src="section.gif" width="13" height="13"> mouseout</font></td></tr></table>
<table cellspacing="0" cellpadding="0"><tr><td><table width="26" cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td><td><font face="verdana,arial,helvetica" size="-1" color="#CC0000">&nbsp;&nbsp;&raquo;&nbsp;font = "verdana,arial,helvetica....." :: Ticker link font</font></td></tr></table>
<table cellspacing="0" cellpadding="0"><tr><td><table width="26" cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td><td><font face="verdana,arial,helvetica" size="-1" color="#CC0000">&nbsp;&nbsp;&raquo;&nbsp;color = #HexColor :: Ticker link color</font></td></tr></table>
<table cellspacing="0" cellpadding="0"><tr><td><table width="26" cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td><td><font face="verdana,arial,helvetica" size="-1" color="#CC0000">&nbsp;&nbsp;&raquo;&nbsp;decoration = "none" "underline" "underline + overline" :: Ticker link style</font></td></tr></table>
<table cellspacing="0" cellpadding="0"><tr><td><table width="26" cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td><td><font face="verdana,arial,helvetica" size="-1" color="#CC0000">&nbsp;&nbsp;&raquo;&nbsp;weight = "normal" "bold" :: Ticker link weight</font></td></tr></table>
<table cellspacing="0" cellpadding="0"><tr><td><table width="26" cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td><td><font face="verdana,arial,helvetica" size="-1" color="#CC0000">&nbsp;&nbsp;&raquo;&nbsp;size = 'any integer'pt :: Ticker link size</font></td></tr></table>
<table cellspacing="0" cellpadding="0"><tr><td><table width="13" cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td><td><font face="verdana,arial,helvetica" size="-1" color="#003399">&nbsp;<img src="section.gif" width="13" height="13"> mouseover</font></td></tr></table>
<table cellspacing="0" cellpadding="0"><tr><td><table width="26" cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td><td><font face="verdana,arial,helvetica" size="-1" color="#CC0000">&nbsp;&nbsp;&raquo;&nbsp;font = "verdana,arial,helvetica....." :: Ticker link font</font></td></tr></table>

<table cellspacing="0" cellpadding="0"><tr><td><table width="26" cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td><td><font face="verdana,arial,helvetica" size="-1" color="#CC0000">&nbsp;&nbsp;&raquo;&nbsp;color = #HexColor :: Ticker link color</font></td></tr></table>
<table cellspacing="0" cellpadding="0"><tr><td><table width="26" cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td><td><font face="verdana,arial,helvetica" size="-1" color="#CC0000">&nbsp;&nbsp;&raquo;&nbsp;decoration = "none" "underline" "underline + overline" :: Ticker link style</font></td></tr></table>
<table cellspacing="0" cellpadding="0"><tr><td><table width="26" cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td><td><font face="verdana,arial,helvetica" size="-1" color="#CC0000">&nbsp;&nbsp;&raquo;&nbsp;weight = "normal" "bold" :: Ticker link weight</font></td></tr></table>
<table cellspacing="0" cellpadding="0"><tr><td><table width="26" cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td><td><font face="verdana,arial,helvetica" size="-1" color="#CC0000">&nbsp;&nbsp;&raquo;&nbsp;size = 'any integer'pt :: Ticker link size</font></td></tr></table>
<img src="section.gif" width="13" height="13"> tickeritem<br>
<table cellspacing="0" cellpadding="0"><tr><td><table width="13" cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td><td><font face="verdana,arial,helvetica" size="-1" color="#CC0000">&nbsp;&raquo;&nbsp;URL = A valid URL :: Ticker link URL</font></td></tr></table>
<table cellspacing="0" cellpadding="0"><tr><td><table width="13" cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td><td><font face="verdana,arial,helvetica" size="-1" color="#CC0000">&nbsp;&raquo;&nbsp;target = "_blank" "_top" "_self" 'any other valid target name' :: Ticker link target</font></td></tr></table>
</font>
</td></tr></table>

<hr color="#000000" style="height:1px">

<table width="100%"><tr><td><a href="http://www.qiksearch.com" class="link">&#1692002 Premshree Pillai. All rights reserved.</td></tr></table>

</td></tr></table>

</body>
</html>

           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo GUI Components
» Ticker