Closed Thread Icon

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

 
compa
Obsessive-Compulsive (I) Inmate

From: malmoe
Insane since: Jun 2000

posted posted 06-03-2000 21:04

Hi.What's wrong with this script? I'm working in Frontpage2000.
Would really appreciate some support.
Thanks. Compa

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>index</title>

<script LANGUAGE="JavaScript">
<!--DocOzone's Javascript code,
copyright 1997
window.onerror = null;
var netscape = 0;
var goodIE = 0;

browserName = navigator.
appName.substring(0,8);
browserVer = parseFloat
(navigator.appVersion);
if (browserName == "Netscape"
&& browserVer >= 3)
{ netscape = 1; }
if (browserName == "Microsof"
&& browserVer >= 3.01)
{ goodIE = 1; }

if (netscape &#0124; &#0124; goodIE) {

menu = new Array(7);
standard = new Array(7);
over = new Array(7);

standard[0].src =new image;
standard[1].src =new image;
standard[2].src =new image;
standard[3].src =new image;
standard[4].src =new image;
standard[5].src =new image;
standard[6].src =new image;


over[0].src = new image;
over[1].src = new image;
over[2].src = new image;
over[3].src = new image;
over[4].src = new image;
over[5].src = new image;
over[6].src = new image;

menu[0].src = new image;
menu[1].src = new image;
menu[2].src = new image;
menu[3].src = new image;
menu[4].src = new image;
menu[5].src = new image;
menu[6].src = new image;

standard[0].src = "navbutt1off.jpg";
standard[1].src = "navbutt2off.jpg";
standard[2].src = "navbutt3off.jpg";
standard[3].src = "navbutt4off.jpg";
standard[4].src = "navbutt5off.jpg";
standard[5].src = "navbutt6off.jpg";
standard[6].src = "midscreen.jpg";


over[0].src = "navbutt1on.jpg";
over[1].src = "navbutt2on.jpg";
over[2].src = "navbutt3on.jpg";
over[3].src = "navbutt4on.jpg";
over[4].src = "navbutt5on.jpg";
over[5].src = "navbutt6on.jpg";
over[6].src = "midscreen.jpg";

menu[0].src = "email.jpg";
menu[1].src = "links.jpg";
menu[2].src = "audioclips.jpg";
menu[3].src = "the band.jpg";
menu[4].src = "transcript.jpg";
menu[5].src = "whoami.jpg";
menu[6].src = "midscreen";

}
function msover(num) {
if (netscape &#0124; &#0124; goodIE) {
document.images[num].src = over[num].src;
document.images[6].src = menu[num].src; } }
function msout(num) {
if (netscape &#0124; &#0124; goodIE) {
document.images[num].src = standard[num].src;
document.images[6].src = menu[6].src; } }
function preload() {
if (netscape &#0124; &#0124; goodIE) {


}}
// -->
</script>

</head>


<body bgcolor="#000000" text="#FFFFFF">

<div align="center">
<center><br>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img border="0" img src="topgen.jpg"></td>
<td><img border="0" img src="topscreen.jpg"></td>
</tr>
<tr>
<td><img border="0" img src="midgen.jpg"></td>
<td><img border="0" src="midscreen.jpg"></td>
</tr>
<tr>
<td valign="top"><img border="0" src="tubes.jpg"></td>
<td><img border="0" img src="botscreen.jpg"></td>
</tr>
<tr>
<td valign="top"><img border="0" img src="topnav.jpg"></td>


<td rowspan="8" valign="top" width="409"><br>

<font face="Verdana" size="1" color="#FFFFFF"><br>
Welcome to</font><b><i><font face="Verdana" size="1" color="#FFFF00"> &quot;Drummer's
Choice&quot;</font></i></b><font face="Verdana" size="1" color="#FFFFFF"> personal website. Here you'll
soon find different kinds of music related stuff, like transcribed drumpieces,<br>
rudiments, some tunes, audio clips and so on. Feel free to browse
around and don't hesitate to send a mail though this site is still
under<br>
construction.&nbsp;<br>
<i><br>
<br>
Pa Tollbom Swedish musician</i><br></font></td>


</tr>
<tr>
<td valign="top">
<a HREF="mailto:mr.pa@swipnet.se" onmouseover="msover(0); window.status='EMAIL'; return true" onmouseout="msout(0)"><img border="0" img src="navbutt1off.jpg"></a></td>

</tr>
<tr>
<td valign="top">
<a HREF="links.htm" onmouseover="msover(1); window.status='LINKS'; return true" onmouseout="msout(1)"><img border="0" img src="navbutt2off.jpg"></a></td>

</tr>
<tr>
<td valign="top">
<a HREF="templink.htm" onmouseover="msover(2); window.status='AUDIOCLIPS'; return true" onmouseout="msout(2)"><img border="0" img src="navbutt3off.jpg"></a></td>

</tr>
<tr>
<td valign="top">
<a HREF="templink.htm" onmouseover="msover(3); window.status='THE BAND'; return true" onmouseout="msout(3)"><img border="0" img src="navbutt4off.jpg"></a></td>

</tr>
<tr>
<td valign="top">
<a HREF="transcribed.htm" onmouseover="msover(4); window.status='TRANSCRIBED'; return true" onmouseout="msout(4)"><img border="0" img src="navbutt5off.jpg"></a></td>

</tr>
<tr>
<td valign="top">
<a HREF="whoami.htm" onmouseover="msover(5); window.status='WHOAMI'; return true" onmouseout="msout(5)"><img border="0" img src="navbutt6off.jpg"></a></td>

</tr>
<tr>
<td valign="top">
<img border="0" img src="navbot.jpg"></td>



</tr>
</table>
</center>
</div>

</body>

</html>


[This message has been edited by compa (edited 04-06-2000).]

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 06-04-2000 00:09

Always check for missing semi-colans. That is the main area that I find myself messing up with on programs.<P>

compa
Obsessive-Compulsive (I) Inmate

From: malmoe
Insane since: Jun 2000

posted posted 06-04-2000 00:43

Well, appreciate your reply and the hint but unfortunatly this is not the problem in this case. Thanks anyway:-)
Compa

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 06-04-2000 01:22

Ummm....how about ya tell us what problems yer havin'....then we's cin tell ya what the problem is <img border=0 align=absmiddle src="http://www.ozones.com/forum/smile.gif">

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 06-04-2000 01:57

I think I see it. Instead of constantly writing

myarray[0].src = "new image";

write

myarray[0] = new Image();

instead.

It's two seperate things, but I see how someone could be confused about that. You'll understand what's happening there eventually. =)

Skaarjj
Maniac (V) Mad Scientist

From: :morF
Insane since: May 2000

posted posted 06-04-2000 06:34

Is there supossed to be a line that says

if (browserName == "Microsof"

or is it supposed to be

if (browserName == "Microsoft"?





Lepricosa...The Leprosy Ointment. For when your not half the man you used to be.

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 06-05-2000 18:49

Nope, I see what he's doing there, he purposely left out the "t".

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 06-05-2000 22:21

Okay I'm going to put this out there at the beginng and then try to be helpful. I would recommend naming the images individually and using that attribute to swap out the images instead of using the document.images array that just makes it hairy. In this case when you mouse over the mail button the topgen image is the one thats going to change (its the first one)

But onto this. first, when you are setting this up in the first list you don't want the ".src" in the tag. It should be over[0] = new Image (you actually dont need the parentheses but the "I" does need to be capitalized) See cuz this makes a new image in your browser cache. Then in the next go through the list you define the source file. (Make sense?) The other thing I noticed is that you have a space between your vertical slashes in the "OR" statements (

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 06-06-2000 07:02

Okay, this is what I want to know -- can't this be done without having to go through the list twice? Something along the lines of over[num] = new Image; rather than listing each number? I just hate the redundancy....and I know I have seen many scripts that seem shorter and less cumbersome.

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 06-06-2000 08:47

Yah, this is an older version of the script. It should work, but not as elegant as it can be. Here's one that sets 12 images as new image(), and loads them with values. You need to name your images using the same format, but this works great, I use it all the time...

names = new Array("first","second","third","fourth","fifth","sixth");
if (document.images) {
buttons = new Array(12);
for (m=0; m<=5; m++) {
buttons[m] = new Image();
buttons[m].src = names[m]+".gif";
buttons[m+6] = new Image();
buttons[m+6].src = names[m]+"2.gif"; }
}



Your pal, -doc-<P>

« BackwardsOnwards »

Show Forum Drop Down Menu