PDA

View Full Version : 2 hrefs in one click


rockstarmike
08-31-2002, 08:33 PM
one href...
i repeat, i need this in ONE CLICK

i need to make a function (js i guess) that makes it do the work of two links
one of the links being
<a class="content" href="#" id="act0" onClick="ypSlideOutMenu.showMenu('menu3')">

the second being
<a href="chris.html" target="chris">

how would i set this up? and make it reusable, that's just the first
there will also be a similar set up menu1 in the first, mike.html target mike in the second, please help me
ive had some help in other forums, but what people come up with, destroys the original hrefs line of javascript, and causes my slideout function to not work.
late
<3 mikey

jscript_junkie
08-31-2002, 09:51 PM
<a href="chris.html" target="chris" class="content" id="act0" onclick="ypSlideOutMenu.showMenu('menu3');return false">

This is a very nice way to set up your links. That way, those who can't get the menu slide, you can send them to an index page. It makes your page viewable in a lot more browsers. The "return false" cancels the HREF in browsers that have JavaScript on.

<edit my="post" />
A small typo I fixed. Added more info.

joh6nn
08-31-2002, 10:00 PM
<a href="chris.html" target="chris" onClick="ypSlideOutMenu.showMenu('menu3');">

that should do it.

jscript_junkie
08-31-2002, 10:01 PM
That is much better. No wonder why I'm a "newbie" at JavaScript... :D

rockstarmike
09-02-2002, 06:14 PM
thanks for the help, the only reason i didnt do that in the first place was i thought that the target="chris" would affect the onclick and **** my world up

ill try it out
tks a bunch

jscript_junkie
09-02-2002, 07:09 PM
Glad to help.

You're sig's really cool. :D :thumbsup: :cool: :) ;)