Results 1 to 2 of 2

Thread: link into frame

  1. #1
    Join Date
    May 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default link into frame

    http://www.dynamicdrive.com/dynamicindex5/button3.htm

    Please someone help a noob.

    I have a 'header' frame with nav buttons. I want to default target to be the frame called 'middle'. I thought I read the instr correctly but the page does not open. I can use the buttons in parent window np.

    My code:
    <script type="text/javascript">
    <!--
    /***********************************************
    * Rollover background-color button Script- © Dynamic Drive (www.dynamicdrive.com)
    * This notice must stay intact for use
    * Visit http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    //Specify optional button target: "_new" for new window, or name of FRAME target (ie "myframe")
    var buttontarget="middle"
    function change(e, color){
    var el=window.event? event.srcElement: e.target
    if (el.tagName=="INPUT"&&el.type=="button")
    el.style.backgroundColor=color
    }

    function jumpto2(url){
    if (buttontarget=="")
    window.location=url
    else if (buttontarget=="_new")
    window.open(url)
    else
    parent[buttontarget].location=url
    }
    //-->
    </script>

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Are you sure your middle frame is actually named 'middle'? Ex:

    HTML Code:
    <frame name="middle" src="middle_page.htm">
    If so, do you have more than one frameset? The parent is the frameset immediately above the page in question, if there are frames within frames, you may need to alter the script to:

    Code:
    function jumpto2(url){
    if (buttontarget=="")
    window.location=url
    else if (buttontarget=="_new")
    window.open(url)
    else
    top[buttontarget].location=url
    }
    There are many other possibilities. It's hard to say what it is for sure, without seeing your page.

    Please post a link to the page on your site that contains the problematic script so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •