Closed Thread Icon

Preserved Topic: Problem with java script (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=17697" title="Pages that link to Preserved Topic: Problem with java script (Page 1 of 1)" rel="nofollow" >Preserved Topic: Problem with java script <span class="small">(Page 1 of 1)</span>\

 
Hein
Nervous Wreck (II) Inmate

From: Grashoek, The Netherlands
Insane since: Mar 2000

posted posted 03-26-2000 19:00

I have got a problem with this java script. It works fine with IE, but it doesn't work with netscape. Does anybody now what is wrong with it? the page can be found on www.crosswinds.net/~tbartels/2d_art.html <P><html>
<head>
<title>2D Art</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><P><SCRIPT LANGUAGE="JavaScript"><P><!--DocOzone's Javascript code, copyright 1998
// Feel free to borrow and modify this javascript,
// but be sure leave this credit in the source!
// (Please note, the CODE, not the images! <IMG SRC="http://www.ozones.com/forum/smile.gif">
// Your pal, -Dr. Thaddeus Ozone-
// http://www.ozones.com/ <P>window.onerror = null;
var netscape = 0;
var goodIE = 0;
var delay = 10000;
browserName = navigator.appName.substring(0,8);
browserVer = parseFloat(navigator.appVersion);
if (browserName == "Netscape" && browserVer >= 3)
{ netscape = 1; }
if (browserName == "Microsof" && browserVer >= 4)
{ goodIE = 1; }<P>if (document.images) {<P>panels = new Array(2);
for (m=0; m<=10; m++) {
panels[m] = new Image(); }
panels[0].src = "art/buttons/button_brown.jpg";
panels[1].src = "art/buttons/button_blue.jpg";
<P>texts = new Array(7);
for (m=0; m<=6; m++) {
texts[m] = new Image(); }
texts[0].src = "art/buttons/blanktext.jpg";
texts[1].src = "art/buttons/blur.jpg";
texts[2].src = "art/buttons/the_band.jpg";
texts[3].src = "art/buttons/2d_art.jpg";
texts[4].src = "art/buttons/3d_art.jpg";
texts[5].src = "art/buttons/fun_stuff.jpg";
texts[6].src = "art/buttons/links.jpg";
}<P>function swapAup() {
if (document.images) {
document.A.src = panels[1].src; }}
function swapAdown() {
if (document.images) {
document.A.src = panels[0].src; }}
function swapAover() {
if (document.images) {
setTimeout('document.texter.src = texts[1].src',0);
setTimeout('document.texter.src = texts[2].src',100); }}
function swapAout() {
if (document.images) {
setTimeout('document.texter.src = texts[1].src',0);
setTimeout('document.texter.src = texts[0].src',100); }}<P>function swapBup() {
if (document.images) {
document.B.src = panels[1].src; }}
function swapBdown() {
if (document.images) {
document.B.src = panels[0].src; }}
function swapBover() {
if (document.images) {
setTimeout('document.texter.src = texts[1].src',0);
setTimeout('document.texter.src = texts[3].src',100); }}
function swapBout() {
if (document.images) {
setTimeout('document.texter.src = texts[1].src',0);
setTimeout('document.texter.src = texts[0].src',100); }}<P>function swapCup() {
if (document.images) {
document.C.src = panels[1].src; }}
function swapCdown() {
if (document.images) {
document.C.src = panels[0].src; }}
function swapCover() {
if (document.images) {
setTimeout('document.texter.src = texts[1].src',0);
setTimeout('document.texter.src = texts[4].src',100); }}
function swapCout() {
if (document.images) {
setTimeout('document.texter.src = texts[1].src',0);
setTimeout('document.texter.src = texts[0].src',100); }}<P>function swapDup() {
if (document.images) {
document.D.src = panels[1].src; }}
function swapDdown() {
if (document.images) {
document.D.src = panels[0].src; }}
function swapDover() {
if (document.images) {
setTimeout('document.texter.src = texts[1].src',0);
setTimeout('document.texter.src = texts[5].src',100); }}
function swapDout() {
if (document.images) {
setTimeout('document.texter.src = texts[1].src',0);
setTimeout('document.texter.src = texts[0].src',100); }}<P>function swapEup() {
if (document.images) {
document.E.src = panels[1].src; }}
function swapEdown() {
if (document.images) {
document.E.src = panels[0].src; }}
function swapEover() {
if (document.images) {
setTimeout('document.texter.src = texts[1].src',0);
setTimeout('document.texter.src = texts[6].src',100); }}
function swapEout() {
if (document.images) {
setTimeout('document.texter.src = texts[1].src',0);
setTimeout('document.texter.src = texts[0].src',100); }}<P>// -->
</SCRIPT><P>
</head><P><body bgcolor="#FFFFFF" background="art/beige.jpg">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td height="118" width="5%">&nbsp;</td>
<td height="118" width="20%">&nbsp;</td>
<td height="118" width="50%"><img src="art/2d_art.gif" width="512" height="98"></td>
<td height="118" width="20%">&nbsp;</td>
<td height="118" width="5%">&nbsp;</td>
</tr>
<tr>
<td width="5%" height="119">&nbsp;</td>
<td width="20%" height="119">&nbsp;</td>
<td height="119" valign="middle" align="center" width="50%">
<p><font size="3"><i>This</i></font><i><font face="Inkburrow" size="5">
art </font>section contains work I have made during my highschool time.<br>
It also contains several Disney drawings I have made in my spare time.<br>
</i></p>
<p><i>Just click on the small pictures to get a big sized picture.</i><br>
</p>
</td>
<td width="20%" height="119">&nbsp;</td>
<td width="5%" height="119">&nbsp;</td>
</tr>
<tr>
<td width="5%" height="94">&nbsp;</td>
<td width="20%" height="94">
<div align="center"></div>
</td>
<td height="94" valign="middle" align="center" width="50%">
<div align="center">
<p>&nbsp; </p>
</div>
<div align="left"></div>
<div align="left">
<blockquote>
<p>&nbsp;</p>
</blockquote>
</div>
</td>
<td width="20%" height="94">&nbsp;</td>
<td width="5%" height="94">&nbsp;</td>
</tr>
<tr>
<td width="5%" height="81">&nbsp;</td>
<td width="20%" height="81">
<div align="center"><a href="art/Aladdin_big.jpg"><img src="art/Aladdin_thumb.jpg" width="172" height="160" border="0"></a></div>
</td>
<td height="81" width="50%">
<p><b><font size="4"><font color="#0D13FF" size="5">Aladdin</font></font></b></p>
<p><i><font size="3" color="#000000">This is the first etch I have made.
The subject was 'fairy-tales'</font></i></p>
<div align="left"><i><font size="3"><a align="left">Image size: 700 x 644
pixels</a><br>
<a align="left"> Download size: 81.7 kB</a></font></i></div>
</td>
<td width="20%" height="81">
<div align="center"></div>
</td>
<td width="5%" height="81">&nbsp;</td>
</tr>
<tr>
<td width="5%" height="61">&nbsp;</td>
<td width="20%" height="61">&nbsp;</td>
<td width="50%" height="61">
<p align="right">&nbsp;</p>
</td>
<td width="20%" height="61">
<div align="center"></div>
</td>
<td width="5%" height="61">&nbsp;</td>
</tr>
<tr>
<td width="5%" height="192">&nbsp;</td>
<td width="20%" height="192">&nbsp;</td>
<td width="50%" height="192">
<p align="right"><font color="#0000FF" size="5"><b>Keeper of the seven keys</b></font></p>
<p align="right"><i><font size="3">This is the etch I made for my exam.
The subject was 'lyrics'. It's from the song 'Keeper of the seven keys'
by Halloween.</font></i></p>
<p align="right"><i><font size="3"><a>Image size: 477 x 625 pixels</a><br>
<a>Download size: 87 kB</a></font></i></p>
</td>
<td width="20%" height="192">
<div align="center"><a href="art/Keeper_big.jpg"><img src="art/keeper_thumb.jpg" width="148" height="191" border="0"></a></div>
</td>
<td width="5%" height="192">&nbsp;</td>
</tr>
<tr>
<td width="5%" height="167">&nbsp;</td>
<td width="20%" height="167">&nbsp;</td>
<td width="50%" height="167">
<div align="center"></div>
</td>
<td width="20%" height="167">&nbsp;</td>
<td width="5%" height="167">&nbsp;</td>
</tr>
<tr>
<td width="5%" height="48">&nbsp;</td>
<td width="20%" height="48">&nbsp;</td>
<td width="50%" height="48">
<div align="center"> <code onMouseOver="swapAup(); swapAover(); window.status='LOTS and Lots of LINKS'; return true" onMouseout="swapAdown(); swapAout()">
<a href="menu.html"><img src="art/buttons/button_brown.jpg" width="60" name="A" height="59" border="0"></a></code>
<code HREF="" onMouseOver="swapBup(); swapBover(); window.status='LOTS and Lots of LINKS'; return true" onMouseout="swapBdown(); swapBout()">
<img src="art/buttons/button_brown.jpg" width="60" name="B" height="59"></code>
<code HREF="" onMouseOver="swapCup(); swapCover(); window.status='LOTS and Lots of LINKS'; return true" onMouseout="swapCdown(); swapCout()">
<img src="art/buttons/button_brown.jpg" width="60" name="C" height="59"></code>
<code HREF="" onMouseOver="swapDup(); swapDover(); window.status='LOTS and Lots of LINKS'; return true" onMouseout="swapDdown(); swapDout()">
<img src="art/buttons/button_brown.jpg" width="60" name="D" height="59"></code>
<code HREF="" onMouseOver="swapEup(); swapEover(); window.status='LOTS and Lots of LINKS'; return true" onMouseout="swapEdown(); swapEout()">
<img src="art/buttons/button_brown.jpg" width="60" name="E" height="59"></code><br>
<img src="art/buttons/blanktext.jpg" name="texter" width="260" height="40">
</div>
</td>
<td width="20%" height="48">&nbsp;</td>
<td width="5%" height="48">&nbsp;</td>
</tr>
<tr>
<td width="5%" height="153">&nbsp;</td>
<td width="20%" height="153">
<div align="center"></div>
</td>
<td width="50%" height="153">
<div align="center">
<p>- Copyright &copy; 2000 by Tom Bartels, all rights reserved -</p>
</div>
</td>
<td width="20%" height="153">
<div align="center"></div>
</td>
<td width="5%" height="153">&nbsp;</td>
</tr>
</table>
</body>
</html><P>
<P>------------------

DocOzone
Maniac (V) Lord Mad Scientist
Sovereign of all the lands Ozone and just beyond that little green line over there...

From: Stockholm, Sweden
Insane since: Mar 1994

posted posted 03-28-2000 06:17

First off, you can just delete these lines, they don't do anything here...<P>var netscape = 0;
var goodIE = 0;
var delay = 10000;
browserName = navigator.appName.substring(0,8);
browserVer = parseFloat(navigator.appVersion);
if (browserName == "Netscape" && browserVer >= 3)
{ netscape = 1; }
if (browserName == "Microsof" && browserVer >= 4)
{ goodIE = 1; }<P>Now, you've put all of your mouseover calls inside a script tag named <code>, can't say I've ever used this bit. Looks like it'd be cool if it worked, which it doesn't apparently.Put the mouseover script inside the <a href> tag and it'll work in both browsers.<P>-doc-

Hein
Nervous Wreck (II) Inmate

From: Grashoek, The Netherlands
Insane since: Mar 2000

posted posted 03-28-2000 17:50

Thanks for the reply.<P>I've used the <code> tag because when I put the mouseover script inside the <a href> tag I keep getting a blue square around my buttons. I tried everything, but I keep getting these blue squares. Beats me why. <P>The script is working under IE with the <code> tag, but it seems like netscape has a problem with this tag.<P>By the way, those tutorials of yours realy kick ass !!!!<P>------------------

Boudga
Maniac (V) Mad Scientist

From: Jacks raging bile duct....
Insane since: Mar 2000

posted posted 03-28-2000 18:13

Have you tried adding border="0" in your "a href" tag?<P>------------------

2winspapa
Bipolar (III) Inmate

From: Alaska, USA
Insane since: Mar 2000

posted posted 03-28-2000 20:16

That's the ticket! Follow Bouga's advice about border=0, and thought oughta do it.

Hein
Nervous Wreck (II) Inmate

From: Grashoek, The Netherlands
Insane since: Mar 2000

posted posted 03-28-2000 21:42

Thanks, but I figured it out myself this night <IMG SRC="http://www.ozones.com/forum/smile.gif"><P>Thanks for the help. I'm working every day now to get the site online. Hope I will finnish it soon. <P>Oh and Doc, don't be surprised if you find stuff simular to your designs (like the cockeyed design) on my page, but don't worry, all you see on my site has been made by myself.<P>Again thanks for the replies. I'm a happy man now <IMG SRC="http://www.ozones.com/forum/wink.gif"> <P>Just one more question. Why don't I have to use this in my script?<P>var netscape = 0;
var goodIE = 0;
var delay = 10000;
browserName = navigator.appName.substring(0,8);
browserVer = parseFloat(navigator.appVersion);
if (browserName == "Netscape" && browserVer >= 3)
{ netscape = 1; }
if (browserName == "Microsof" && browserVer >= 4)
{ goodIE = 1; }<P>What is it for anyway?<P>------------------<P>
[This message has been edited by Hein (edited 28-03-2000).]<p>[This message has been edited by Hein (edited 28-03-2000).]

DocOzone
Maniac (V) Lord Mad Scientist
Sovereign of all the lands Ozone and just beyond that little green line over there...

From: Stockholm, Sweden
Insane since: Mar 1994

posted posted 03-28-2000 22:17

Well, the delay=10000 bit was for a setTimeout() thing later on, not used on that script at all. The other part was a holdover from when I used to check browser type and version, and use THAT for deciding whether to process the mouseover or not. Still a useful thing to know, sometimes you just have to know the specific browser bits. Try that variable in a document.write(), and see what browser you have, eh?<P>Your pal, -doc-
<P>------------------
----- Doctor Thaddeus Ozone --------- "Specialization is for insects"---
  --- OZONE pages .................................. http://www.ozones.com/
    - Hands-On Tutorials ............ http://www.ozones.com/handson/

Hein
Nervous Wreck (II) Inmate

From: Grashoek, The Netherlands
Insane since: Mar 2000

posted posted 03-29-2000 11:08

Thanks. Everything works now, thank God <IMG SRC="http://www.ozones.com/forum/biggrin.gif"><P>------------------

Hoju
Neurotic (0) Inmate
Newly admitted
posted posted 03-30-2000 08:50

<code> is a text-formatting tag like <b> and <i>, it's meant to display text in a fixed width font (ie. for code source). The only reason it works in IE is that IE supports every event for every tag, even if it doesn't make sense <IMG SRC="http://www.ozones.com/forum/rolleyes.gif">

Hein
Nervous Wreck (II) Inmate

From: Grashoek, The Netherlands
Insane since: Mar 2000

posted posted 03-30-2000 10:21

Well that explains everything. Glad I figured it all out now. Hope my site will be up this week. I will let you know to give some critism on it. <P>------------------

« BackwardsOnwards »

Show Forum Drop Down Menu