Results 1 to 2 of 2

Thread: opening a link in another frame

  1. #1
    Join Date
    Oct 2004
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy opening a link in another frame

    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

  2. #2
    Join Date
    Aug 2004
    Location
    Brighton
    Posts
    1,563
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

    cr3ative
    A retired member, drop me a line through my site if you'd like to find me!
    cr3ative media | read the stickies

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •