PDA

View Full Version : opening a link in another frame



baby_j0ker187
10-12-2004, 01:58 PM
my menu is in the left side frame n im tryin to open da link in da frame on da right im using this code :


<style>
#innermenu a{
text-decoration:none;
}

#innermenu a:hover{
background-color:WHITE;

}

</style>

<script language="JavaScript1.2">

//DHTML combo box script- by javascriptkit.com
//Visit JavaScript Kit (http://www.javascriptkit.com) for script
//Credit must stay intact for use

var ie5=(document.getElementById&&navigator.appName.indexOf("Internet Explorer")!=-1)

if (ie5){
document.write('<span style="position:relative;width:150px;height:20px;border:1px ;font:10pt BANKGOTHIC LT BT;padding:2px" onClick="showhide(1);event.cancelBubble=1" ><span style="cursor: hand ;width:100%">MAH PAGEZ<img src="tridown.gif"></span>')
document.write('<div id="innermenu" style="position:absolute;left:2;top:16;width:140px;height:100px;border:1px #525152;background-color:;overflow-y:;visibility:hidden;">')
}

function gl(linkname,dest){
document.write('<b><a href="'+dest+'">'+linkname+'</a></b><br>')
}

function showhide(state){
var cacheobj=document.getElementById("innermenu").style
if (state==0)
cacheobj.visibility="hidden"
else
cacheobj.visibility=cacheobj.visibility=="hidden"? "visible" : "hidden"
}

//Specify your links here- gl(Item text, Item URL)
if (ie5){
gl("grafix","grafix.html")
gl("grafix1","grafix1.html")
gl("grafix2","grafix2.html")
gl("grafix3","grafix3.html")
gl("grafix4","grafix4.html")
gl("Google","http://www.google.com")
gl("Yahoo","http://www.yahoo.com")
gl("CNN","http://cnn.com")
//Extend this list as needed


}

if (ie5){
document.onclick=function(){showhide(0)}
document.write('</div></span>')
}

</script>



but i dont know how to make it open on da frame on the right .. would really appreciate it if anyone can help

cr3ative
10-12-2004, 02:51 PM
I think you need to change this line from

document.write('<b><a href="'+dest+'">'+linkname+'</a></b><br>')

to

document.write('<b><a href="'+dest+'" target="framename">'+linkname+'</a></b><br>')

replacing framename with the name of the frame :p

cr3ative