homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
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

 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!


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);
setTimeout("scrollnews(" + cliptop + ")", 80);

<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">
<script language="javascript">
document.write('<img src=' + blank + ' width=1 height='+boxheight+'>');

<!-- These are the text lines that show on screen-->
Etelä-Pohjanmaan matkailu<br>
Tänään on ukkosta ilmassa<br></FONT>
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>

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



 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.


 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


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


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