Could those who have time take a look? - (was "Javascript rollover")

The geek forum. PHP, Perl, HTML, hardware questions etc.. it's all in here. Got a techie question? We'll sort you out. Ask your questions or post a link to your own site here!

Javascript rollover

Postby inkhana » Fri Jan 16, 2004 12:52 pm

OK, I was working on my site with the plan of putting some javascript image rollovers on it. This javascript was one that came with my HTML editor and goes like this:

<!-- START OF SCRIPT -->
<!-- For more scripts visit (URL omitted since the site's gone anyhow) -->
<SCRIPT LANGUAGE="JAVASCRIPT">
nav3=false;
/*If this is navigator 3*/
if((navigator.appName == "Netscape") && (navigator.appVersion.substring(0,1) >= "3"))
{
/*Set the flag*/
nav3=true;
/*prepare array of rollover images and click images*/
rollOver = new Array
/*LIST YOUR ROLLOVER IMAGES HERE*/
rollOver[0] = new Image(51,21)
rollOver[0].src="images/layout2_02unflash.gif"
rollOver[1] = new Image(51,21)
rollOver[1].src="images/layout2_02flash.gif"
/*******************************************************/
/* CEASE YOUR TAMPERING HERE! */
/*******************************************************/
}
/*If this is navigator 3, swaps image n on screen for image m in rollOver array*/
function rollSwitch(name,m)
{ if(nav3) { picSwap(name, rollOver[m]) }}
/*Swaps the image field in image object i1 for the image fields in image object i2. And vice versa*/
function picSwap(i1,i2){
var temp = i1.src
i1.src=i2.src
i2.src=temp}
// -->
</SCRIPT>



--------And here is how it was supposed to be activated in the webpage-----



<a href="jake"
onMouseOver="rollSwitch(document.hme,1)"
onMouseOut="rollSwitch(document.hme,0)" target="MainScreen">
<img src="images/layout2_02unflash.gif" border=0 NAME="hme"></a>

Now, assuming that my pics are indeed in the subdirectory /images/ and all files are layout02_*.gif (and that "jake" of course, is not really what goes there), can someone tell me why this script produces no effect at all in the page? (Not even an error) The whole layout consists of image slices within a table, and the cell in which the second part of the script went has a background image named layout02_2.gif.

Thanks!


BOOSTER: Hey, No.1! Where's my cake?!
SNIFIT 1: Booster, Sir! There's a 70% chance the object you're standing on is a cake.
BOOSTER: What? THIS thing's a cake?

You have the power to say anything you want, so why not say something positive?
- Frank Capra

(in response to an interview question "Do you have a pet peeve having to do with this biz?")
People who write below their abilities in order to crank out tons of books and make a buck. Especially Christian authors who do that. Outsiders judge us for it, and make fun of us for it, and it makes Jesus look bad. We of all artists on earth should be the most concerned with doing our best possible work at all times. We of all people should write with all our hearts, as if writing for the Lord and not for men.
- Athol Dickson


Avatar by scarlethibiscus from LJ.
User avatar
inkhana
 
Posts: 3670
Joined: Fri May 30, 2003 10:00 am
Location: meh.

Postby Mithrandir » Fri Jan 16, 2004 1:58 pm

inkhana wrote:
<a href="jake"
onMouseOver="rollSwitch(document.hme,1)"
onMouseOut="rollSwitch(document.hme,0)" target="MainScreen">
<img src="images/layout2_02unflash.gif" border=0 NAME="hme"></a>



Hmm. I don't see a semicolon at the end of your javascript command. Is this on purpose? Also, I usually recommend the onmouseover not be capitalized. Some browsers reportedly have issues with it. Let me know if this doesn't work, k?
User avatar
Mithrandir
 
Posts: 11071
Joined: Fri Jun 27, 2003 12:00 pm
Location: You will be baked. And then there will be cake.

Postby inkhana » Fri Jan 16, 2004 3:32 pm

Oldphil helped me fix it...^^ Thank you!


BOOSTER: Hey, No.1! Where's my cake?!
SNIFIT 1: Booster, Sir! There's a 70% chance the object you're standing on is a cake.
BOOSTER: What? THIS thing's a cake?

You have the power to say anything you want, so why not say something positive?
- Frank Capra

(in response to an interview question "Do you have a pet peeve having to do with this biz?")
People who write below their abilities in order to crank out tons of books and make a buck. Especially Christian authors who do that. Outsiders judge us for it, and make fun of us for it, and it makes Jesus look bad. We of all artists on earth should be the most concerned with doing our best possible work at all times. We of all people should write with all our hearts, as if writing for the Lord and not for men.
- Athol Dickson


Avatar by scarlethibiscus from LJ.
User avatar
inkhana
 
Posts: 3670
Joined: Fri May 30, 2003 10:00 am
Location: meh.

Postby Mithrandir » Fri Jan 16, 2004 5:54 pm

And an elegent solution 'twas! If anyone else ever wants to do this, just copy the code to update the graphic name directly into the "onmouseover" lines.

- OldPhil.
User avatar
Mithrandir
 
Posts: 11071
Joined: Fri Jun 27, 2003 12:00 pm
Location: You will be baked. And then there will be cake.

Postby inkhana » Sat Jan 17, 2004 9:22 am

http://steelblood.christianmanga.com/v2/layoutoldphil.html

Here's the aforementioned layout - I just wanted to make sure that things were working the way they were supposed to on multiple browsers. Would those who have time mind taking a look and seeing if the layout appears broken (or if anything else looks crazy)? Also, all the little circles should light up when touched with the mouse (the first time it takes a just a sec to happen though). I'd also appreciate any critique on the layout...:) I don't do this very often but I'm trying to get better at designs and such. Oh! And one more thing. All of the links will 404 if you click them, because I haven't designed the new pages to go with them yet. There should, however, be a page that loads within the frame on the right.

Thanks!


BOOSTER: Hey, No.1! Where's my cake?!
SNIFIT 1: Booster, Sir! There's a 70% chance the object you're standing on is a cake.
BOOSTER: What? THIS thing's a cake?

You have the power to say anything you want, so why not say something positive?
- Frank Capra

(in response to an interview question "Do you have a pet peeve having to do with this biz?")
People who write below their abilities in order to crank out tons of books and make a buck. Especially Christian authors who do that. Outsiders judge us for it, and make fun of us for it, and it makes Jesus look bad. We of all artists on earth should be the most concerned with doing our best possible work at all times. We of all people should write with all our hearts, as if writing for the Lord and not for men.
- Athol Dickson


Avatar by scarlethibiscus from LJ.
User avatar
inkhana
 
Posts: 3670
Joined: Fri May 30, 2003 10:00 am
Location: meh.

Postby ShiroiHikari » Sat Jan 17, 2004 9:24 am

Looks good, Ink ;D
fightin' in the eighties
User avatar
ShiroiHikari
 
Posts: 7564
Joined: Wed May 28, 2003 12:00 pm
Location: Somewhere between 1983 and 1989

Postby madphilb » Sat Jan 17, 2004 10:29 am

Looks sharp.

I'm guessing that the graphical links on the side aren't all done yet (as in they don't have a link to them or the rollover).

BTW - viewd it with Firebird.... looked fine.
PHIL

Image
Member of P.I.E. -- Pictures of Inkhana for Everyone!! Join the fight!!
Image
User avatar
madphilb
 
Posts: 1057
Joined: Thu May 29, 2003 1:46 pm
Location: Sunny St. Pete, FL

Postby inkhana » Sat Jan 17, 2004 10:35 am

Yeah...I thought I made the links last night but oh well...^^;;; It was about two in the morning anyhow...:P But so far everyone who has looked at it says the layout seems to be free of bad glitches...so far so good...*hopes* Thanks!


BOOSTER: Hey, No.1! Where's my cake?!
SNIFIT 1: Booster, Sir! There's a 70% chance the object you're standing on is a cake.
BOOSTER: What? THIS thing's a cake?

You have the power to say anything you want, so why not say something positive?
- Frank Capra

(in response to an interview question "Do you have a pet peeve having to do with this biz?")
People who write below their abilities in order to crank out tons of books and make a buck. Especially Christian authors who do that. Outsiders judge us for it, and make fun of us for it, and it makes Jesus look bad. We of all artists on earth should be the most concerned with doing our best possible work at all times. We of all people should write with all our hearts, as if writing for the Lord and not for men.
- Athol Dickson


Avatar by scarlethibiscus from LJ.
User avatar
inkhana
 
Posts: 3670
Joined: Fri May 30, 2003 10:00 am
Location: meh.

Postby wiggins » Sat Jan 17, 2004 3:54 pm

That's really beautiful! I've never made a website in my life, but if I were to do so, I would want to make one like that!
Being a Christian makes me a different otaku; Being an otaku doesn't make me a different Christian!
User avatar
wiggins
 
Posts: 613
Joined: Sun Oct 26, 2003 9:42 am
Location: London


Return to Computing and Links

Who is online

Users browsing this forum: No registered users and 79 guests