Announcement

Collapse
No announcement yet.

Go menu link to I-frame

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Go menu link to I-frame

    Hi everybody,

    Radek, a member of the forum, has asked for a way to link the options in a Go menu, to an I-frame. Indeed, this is something not provided as a standard feature in the Go menu.

    Well, here's the solution:

    1. Create the Go menu as usual. Put in it all the required options and for each option give the necessary URL.

    2. Move your Go menu, at the very top left corner of the page.

    3. Right click on it and go to Object html. Copy the code that will look like:


    <FORM name="GoMenuForm2" action="">
    <SELECT name="GoMenu" style="width:119px">
    <OPTION selected>Select a link</OPTION>
    <OPTION value="http://www.yoursite.com/page_in_the_frame1.html>option1</OPTION>
    <OPTION value=http://www.yoursite.com/page_in_the_frame2.html>option2</OPTION>
    </SELECT>
    <INPUT type="button" value="Go" onclick="OnGoMenuForm2Link()">
    </FORM>
    <SCRIPT language="JavaScript" type="text/javascript">
    function OnGoMenuForm2Link()
    {
    var url = document.GoMenuForm2.GoMenu.options[document.GoMenuForm2.GoMenu.selectedIndex].value +"";
    if (url != '')
    {
    if(parent != self)
    {
    var doc = self;
    while(doc != window.top)
    {
    doc = doc.parent;
    }
    if(url.indexOf("://")!=-1)
    {
    doc.body.window.location.href = url;
    }
    else
    {
    window.framename.location.href = url;
    }
    }
    else
    {
    window.framename.location.href = url;
    }
    document.GoMenuForm2.GoMenu.selectedIndex=0;
    }
    }
    </SCRIPT>


    Replace the blue text (which is originally "top") with the name of your frame, here called "framename".

    Insert a HTML box. Double click it to edit it, and paste in the html box the code you have copied.This will create a new Go menu in your page, with the links you have originaly given it, but now it will open the linked page in the iframe.

    Delete the original Go menu. You're done!

    Please feel free to try it at http://www.navaldesign.info/Tips/goinframe.html

    The reason that i told you to move the Go menu in the upper left corner, is that in this way you obtain top and left margins 0. So now you can move the html box anywhere in your page. The whole procedure takes 3 minutes but you obtain a result that cannot be done directly in BV.

    A small tip: If before deleting the original Go menu, you make the html box the same size as your original Go menu, using the Make Same Size tool, it will be much easier to have a visual control when you will need to position it in the correct position.

    P.S. In the wish Bin there is a poll regarding the Tips & Tricks Section that you're reading right now. Please take just 30 secs to express your opinion. The poll is at the top of this thread: http://www.vodahost.com/vodatalk/wis...ion-forum.html

    Thanks!
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

Working...
X