Partizan
05-07-2009, 09:34 AM
Hello,
I have a News Ticker script that works fine on one website (.html) but does not on my new website (.shtml)
I am not sure why and whether the issue is the different extensions or whether it is different DOC TYPES. I did change the HTML to SHTML is the below but didn't make any difference.
This is the code that works on my .html page:
HEAD
<SCRIPT LANGUAGE="JavaScript">
var newslist=new Array();
var cnt=0; // current news item
var curr = "";
var i=-1; // current letter being typed
newslist[0]=new Array("The Legoland Times has moved home! Please visit our new home at www.minifigtimes.com","http://www.minifigtimes.com")
newslist[1]=new Array("Happy building! :)","http://www.minifigtimes.com")
function newsticker()
{
// next character of current item
if (i < newslist[cnt][0].length - 1)
{
i++;
temp1 = newslist[cnt][0];
temp1 = temp1.split('');
curr = curr+temp1[i];
temp2 = newslist[cnt][1];
mtxt.innerHTML = "<a href='"+temp2+"'>"+curr+" _</a>";
setTimeout('newsticker()',35)
return;
}
// new item
i = -1; curr = "";
if (cnt<newslist.length-1)
cnt++;
else
cnt=0;
setTimeout('newsticker()',6500)
}
</script>
</HEAD>
BODY
<BODY onLoad="newsticker()">
<span id="mtxt" style="position:relative;top:1px;padding:5px 5px 5px 5px;font-family:arial;font-size:10pt;width:100%;overflow:auto;height:75px">
</span>
I have set up a test page here: http://www.minifigtimes.com/index6.shtml
This is the page where it is working: http://legolandtimes.bravehost.com/
One other thing I want to do is be able to call a class for the text size / font etc. How do I do this ? I want to remove font-family:arial;font-size:10pt; or
as many of these kind of attributes and replace with CSS.
Any help much appreciated! thanks
I have a News Ticker script that works fine on one website (.html) but does not on my new website (.shtml)
I am not sure why and whether the issue is the different extensions or whether it is different DOC TYPES. I did change the HTML to SHTML is the below but didn't make any difference.
This is the code that works on my .html page:
HEAD
<SCRIPT LANGUAGE="JavaScript">
var newslist=new Array();
var cnt=0; // current news item
var curr = "";
var i=-1; // current letter being typed
newslist[0]=new Array("The Legoland Times has moved home! Please visit our new home at www.minifigtimes.com","http://www.minifigtimes.com")
newslist[1]=new Array("Happy building! :)","http://www.minifigtimes.com")
function newsticker()
{
// next character of current item
if (i < newslist[cnt][0].length - 1)
{
i++;
temp1 = newslist[cnt][0];
temp1 = temp1.split('');
curr = curr+temp1[i];
temp2 = newslist[cnt][1];
mtxt.innerHTML = "<a href='"+temp2+"'>"+curr+" _</a>";
setTimeout('newsticker()',35)
return;
}
// new item
i = -1; curr = "";
if (cnt<newslist.length-1)
cnt++;
else
cnt=0;
setTimeout('newsticker()',6500)
}
</script>
</HEAD>
BODY
<BODY onLoad="newsticker()">
<span id="mtxt" style="position:relative;top:1px;padding:5px 5px 5px 5px;font-family:arial;font-size:10pt;width:100%;overflow:auto;height:75px">
</span>
I have set up a test page here: http://www.minifigtimes.com/index6.shtml
This is the page where it is working: http://legolandtimes.bravehost.com/
One other thing I want to do is be able to call a class for the text size / font etc. How do I do this ? I want to remove font-family:arial;font-size:10pt; or
as many of these kind of attributes and replace with CSS.
Any help much appreciated! thanks