PDA

View Full Version : Help! Is it possible to make a link null?



SteVis
Mar 24th, 2003, 04:37 AM
Hey, On my menu here, http://www.huronvalley.k12.mi.us/schools/mhs/
Say for the home button, i want it so you can put your mouse over it and it performs every function but when you click on it i want nothing to happen. Instead of opening the homepage up again, in a new window...

Antoniohawk
Mar 24th, 2003, 04:43 AM
if your link was like this:

<a href="" onMouseOver="blah()">BLAH</a>

then to make it so it doesnt reload the page i suggest u add return false at the end:

<a href="" onMouseOver="blah()" return false>BLAH</a>

im pretty sure that will work, if not then say so and i might b able to help or there will b some1 else that can.

SteVis
Mar 24th, 2003, 04:58 AM
It's more like...

Menu1=new Array("Home","http://www.huronvalley.k12.mi.us/schools/mhs/","",0,20,90);

But with some added code to make it open in a new window....

Thanks a lot for the reply

Spookster
Mar 24th, 2003, 05:06 AM
First you said:



when you click on it i want nothing to happen


then you said:



make it open in a new window


Is it suppose to open in a new window when clicked on or do you want nothing to happen when it is clicked on?

If you want nothing to happen then take the link out and put a pound sign in:

Menu1=new Array("Home","#","",0,20,90);

If you want it to open in a new window then use javascript to open it in a new window:

Menu1=new Array("Home","javascript:window.open('http://www.huronvalley.k12.mi.us/schools/mhs/')","",0,20,90);

SteVis
Mar 24th, 2003, 05:08 AM
Thanks spooks, sorry for that, but i wanted nothing to happen. It already opens in new window =p. Mucho gracias...

Antoniohawk
Mar 24th, 2003, 05:11 AM
hey spookster, i always add return false to my links that i dont want to go anywhere, wat does that actually mean?

Skyzyx
Mar 24th, 2003, 05:23 AM
This is a quote from a brilliant web designer who calls himself "YoungPup":

But you, evil web author from the depths of hell, have anticipated my desire. You guessed that I might want this resource opened in a new window. Unfortunately for me, you are dim-witted enough to consider but one possibility: that I will click normally on the link, encounter a pop-up window, and marvel at your ingenuity.

You do not consider, for instance, that I may right-click on the link, as I do habitually when I want to read content in a new window. You do not consider that I may wish to bookmark this link and read it later. Nor do you consider that I may attempt to print the contents of this link, drag it to my desktop, or put it in my favorites bar.

Nope. In you complete, utter, and hopefully *not* hopeless idiocy, you consider but one possibility. In doing so, you and all of your ilk ban me to a life of javascript errors and blank windows. You cause me and others like me a web experience filled with frustration.

I hate you. I despise you. I wish for your sudden and excruciating death with every ounce of my being every single time I click one of your god-forsaken pretend hyperlinks. I swear to all the Gods in all the religions, that the next time this happens to me, somebody will pay. Oh yes. Somebody will be sorry.

The entire article can be read at http://www.youngpup.net/?request=/articles/how-to-create-popups.xml

Anyways, I agree with his ideas regarding popups (or other new windows).

However, regarding not wanting anything to happen when you click a link, try this:



<a href="javascript:void(0);" onclick="window.open('http://www.huronvalley.k12.mi.us/schools/mhs/');">Link</a>


Hope this helps!

Untitled
Mar 24th, 2003, 09:06 PM
Just put one of these # things and it should work.

boywonder
Mar 25th, 2003, 12:48 AM
Good Lord! that youngpup fella needs to lighten up!

but he's right. ;)

BTW I tried to view his "soopa rollovers" in my favorite browser and they didnt' work..... so no I wish for his sudden and excruciating death... :D

SteVis
Mar 25th, 2003, 04:24 PM
Hey, When i put the "#" in, it just opens the top.htm right below it. so the page is just two of the top frames stacked on top of eachother. Any ideas upon how to fix it?

Spookster
Mar 25th, 2003, 05:21 PM
get rid of the frames. you don't need them.