Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Dec 2003
    Location
    WA, Australia
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Javascript Menu - Opening new page over frames page

    Hello

    I currently have a home page made up of two frames (horizontal menu (top), content (bottom) )

    My goal is to click on my 'Training & Development' button and the frames will be replaced with the Training page only instead of showing in the content frame with the menu frame still there.

    I do not know the code to write in the .js document in order to make this happen, I would be most appreciative if anyone can help?!?

    The following is an excert from the .js document i think i need to add the relevant code into:

    Menu6=new Array("Training & Development","Training Home Frame.htm","",1,45,100);

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    You must post the whole menu script.
    Hint, if the menu is a hyperlink, the output should be:

    <a href="training.htm" target="nameOfFrame">Training</a>
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #3
    New Coder
    Join Date
    Dec 2003
    Location
    WA, Australia
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the reply, but the menu is in js not html. The following is the relevant HV script if it helps (sourced from dynamicdrive.com)... Any ideas what i'm missing ??


    var NoOffFirstLineMenus=2; // Number of first level items
    var LowBgColor='#800000'; // Background color when mouse is not over
    var LowSubBgColor='#993333'; // Background color when mouse is not over on subs
    var HighBgColor='#800000'; // Background color when mouse is over
    var HighSubBgColor='#800000'; // Background color when mouse is over on subs
    var FontLowColor='white'; // Font color when mouse is not over
    var FontSubLowColor='white'; // Font color subs when mouse is not over
    var FontHighColor='yellow'; // Font color when mouse is over
    var FontSubHighColor='yellow'; // Font color subs when mouse is over
    var BorderColor='white'; // Border color
    var BorderSubColor='white'; // Border color for subs
    var BorderWidth=1; // Border width
    var BorderBtwnElmnts=1; // Border between elements 1 or 0
    var FontFamily="arial,comic sans ms,technical" // Font family menu items
    var FontSize=8; // Font size menu items
    var FontBold=1; // Bold menu items 1 or 0
    var FontItalic=0; // Italic menu items 1 or 0
    var MenuTextCentered='left'; // Item text position 'left', 'center' or 'right'
    var MenuCentered='left'; // Menu horizontal position 'left', 'center' or 'right'
    var MenuVerticalCentered='top'; // Menu vertical position 'top', 'middle','bottom' or static
    var ChildOverlap=.2; // horizontal overlap child/ parent
    var ChildVerticalOverlap=.2; // vertical overlap child/ parent
    var StartTop=0; // Menu offset x coordinate
    var StartLeft=0; // Menu offset y coordinate
    var VerCorrect=0; // Multiple frames y correction
    var HorCorrect=0; // Multiple frames x correction
    var LeftPaddng=3; // Left padding
    var TopPaddng=2; // Top padding
    var FirstLineHorizontal=1; // SET TO 1 FOR HORIZONTAL MENU, 0 FOR VERTICAL
    var MenuFramesVertical=0; // Frames in cols or rows 1 or 0
    var DissapearDelay=1000; // delay before menu folds in
    var TakeOverBgColor=1; // Menu frame takes over background color subitem frame
    var FirstLineFrame='MyFrameOne'; // Frame where first level appears
    var SecLineFrame='MyFrameTwo'; // Frame where sub levels appear
    var DocTargetFrame='MyFrameTwo'; // Frame where target documents appear
    var TargetLoc='MenuPos'; // span id for relative positioning
    var HideTop=0; // Hide first level when loading new document 1 or 0
    var MenuWrap=1; // enables/ disables menu wrap 1 or 0
    var RightToLeft=0; // enables/ disables right to left unfold 1 or 0
    var UnfoldsOnClick=0; // Level 1 unfolds onclick/ onmouseover
    var WebMasterCheck=0; // menu tree checking on or off 1 or 0
    var ShowArrow=""; // Uses arrow gifs when 1
    var KeepHilite=1; // Keep selected path highligthed
    var Arrws=['tri.gif',5,10,'tridown.gif',10,5,'trileft.gif',5,10]; // Arrow source, width and height

    function BeforeStart(){return}
    function AfterBuild(){return}
    function BeforeFirstOpen(){return}
    function AfterCloseAll(){return}


    // Menu tree
    // MenuX=new Array(Text to show, Link, background image (optional), number of sub elements, height, width);
    // For rollover images set "Text to show" to: "rollover:Image1.jpg:Image2.jpg"



    Menu1=new Array("Training & Development","Training Home Frame.htm","",1,40,100);

    Menu2=new Array("Example","Example.htm","",1,40,100);

  • #4
    New Coder
    Join Date
    Dec 2003
    Location
    WA, Australia
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    I'm getting there...

    I'm getting there, managed to find some code that sort of does what i'm, after but i want it to open the whole page in that browser not open another...

    Menu6=new Array("Training & Development","javascript: window.open('file:///w:/TRAINnet/Frames/Home Frame.htm')","",1,45,100)

    Need the language to replace 'open'

    As you can see my js knowledge is pitiful. Thanks in advance !!

  • #5
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Menu6=new Array("Training & Development","javascript:void window.open('training.htm','nameOfTargetFrame')","",1,45,100);

    or

    Menu6=new Array("Training & Development","javascript:top.frames['nameOfTargetFrame'].location.href='training.htm'","",1,45,100);
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #6
    New Coder
    Join Date
    Dec 2003
    Location
    WA, Australia
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Mate, works a treat !



  •  

    Posting Permissions

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