homepage Welcome to WebmasterWorld Guest from 54.196.162.238
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
JavaScript don't work on Netscape 7.0
Please someone help for this script to work
karqa




msg:1477455
 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




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

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




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

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




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

<SCRIPT LANGUAGE="JavaScript">

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

<script type="text/javascript">

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved