Welcome to WebmasterWorld Guest from 54.160.163.163

Forum Moderators: open

Message Too Old, No Replies

JavaScript don't work on Netscape 7.0

Please someone help for this script to work

     

karqa

6:50 am on Jun 6, 2003 (gmt 0)



I can't get this news scrollet code to work on netscape 7.0. It work file on explorer. SO can anybody help me? please!

<SCRIPT LANGUAGE="JavaScript">

<!--
var blank = "blank.gif";

topedge = 400;
leftedge = 200;
boxheight = 50;
boxwidth = 300;
scrollheight = 120;

function scrollnews(cliptop) {
if (document.layers) {
newsDiv = document.news;
newsDiv.clip.top = cliptop;
newsDiv.clip.bottom = cliptop + boxheight;
newsDiv.clip.left = 0;
newsDiv.clip.right = boxwidth + leftedge;
newsDiv.left = leftedge;
newsDiv.top = topedge - cliptop;
}
else {
newsDiv = news.style;
newsDiv.clip = "rect(" + cliptop + "px " + (boxwidth + leftedge) + "px " + (cliptop + boxheight) + "px 0px)";
newsDiv.pixelLeft = leftedge;
newsDiv.pixelTop = topedge - cliptop;
}
cliptop = (cliptop + 1) % (scrollheight + boxheight);
newsDiv.visibility='visible';
setTimeout("scrollnews(" + cliptop + ")", 80);
}
//-->
</script>
</HEAD>

<BODY OnLoad="scrollnews(0)">

<div ID="news" style="position:absolute; visibility:hidden;
top:1; left:1; height:100;
clip:rect(10,100,100,10); border-width:0px;">
<table border=0 cellpadding=1 cellspacing=0 bgcolor="white">
<tr>
<td>
<script language="javascript">
document.write('<img src=' + blank + ' width=1 height='+boxheight+'>');
</script>
</td>
</tr>
<tr>
<td>

<!-- These are the text lines that show on screen-->
<H2><B>
<FONT FACE="VERDANA" COLOR="BLUE">
Etelä-Pohjanmaan matkailu<br>
Tänään on ukkosta ilmassa<br></FONT>
<FONT FACE="HELVETICA" COLOR="GREEN">
Mökkejä vielä vapaana! Soita 06-123456<br>
Muistathan Tangomarkkinat Seinäjoella 10.-13.7.2003<br>
Tule sinäkin lomailemaan eteläpohjanmaalle <br></FONT>

</tr>
<tr>
<td>
<script language="javascript">
document.write('<img src=' + blank + ' width=1 height='+boxheight+'>');
</script>
</td>
</tr>
</table>
</div>

Sinner_G

7:27 am on Jun 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you tried putting your variables (topedge, leftedge,...) into the function? Don't ask me why, but it solved a simimlar problem for me once.

Xuefer

8:22 am on Jun 6, 2003 (gmt 0)

10+ Year Member



document.layers is not the way to detect ns7
it's no longer supported

and "newsDiv = news.style;"

is ie only

u have to newsDiv = document.getElementById('news').style;

and notice that, style and Div is not the same
rename your variable

bird

1:49 pm on Jun 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<SCRIPT LANGUAGE="JavaScript">

This isn't correct HTML, it's a Microsoft-only extension. What you need instead is this:

<script type="text/javascript">
 

Featured Threads

Hot Threads This Week

Hot Threads This Month