Results 1 to 2 of 2

Thread: tageting to an iframe

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

    Exclamation tageting to an iframe

    I know that this post is similar to others, and I've looked through them. I'm new to javascript coding; really not familiar with it at all. I'm working on a project for one of my highschool classes, and I just used some software to create a dhtml/javascript menu. The problem is that I want the links to open within an iframe.
    The script for this menu is ridiculously long, and I've looked through it trying to find an indication of where I could set a target for the links, but I haven't been successful in doing so.
    I've linked to the script from my index page as to keep the html somewhat tidy, and just used a span to position it.

    I had to attach the js file, cause it was too long to paste here.Attachment 1324I want to target the links to an iframe called content.

    Thanks all.

    Erm, so a few views, but no comments at all. Perhaps because i have the file attached like that. *shrugs* It's too long to paste here. Well, here's the code for the menu's layout; not the function:
    Code:
    function Go(){return}
    
    Menu1=new Array("Home","./index.htm","",0,20,84);
    
    Menu2=new Array("About","","",3,0,84);
      Menu2_1=new Array("The Project","./about/project.htm","",0,20,84);
      Menu2_2=new Array("The Utilities","./about/utility.htm","",0,20,84);
      Menu2_3=new Array("The Creator","./about/creator.htm","",0,20,84);
    
    Menu3=new Array("Photography","./photo/index.htm","",1,0,86);
      Menu3_1=new Array("Albums","","",2,20,84);
       Menu3_1_1=new Array("Québec","./photo/quebec.htm","",0,20,84);
       Menu3_1_2=new Array("Randoms","./photo/random.htm","",0,20,84);
    
    Menu4=new Array("Contact","./contact.htm","",0,0,84);
    
    
    var NoOffFirstLineMenus=4;	// Number of first level items
    var LowBgColor='8F8769';		// Background color when mouse is not over
    var LowSubBgColor='8F8769';	// Background color when mouse is not over on subs
    var HighBgColor='AAA48A';		// Background color when mouse is over
    var HighSubBgColor='AAA48A';	// Background color when mouse is over on subs
    var FontLowColor='FFFFFF';		// Font color when mouse is not over
    var FontSubLowColor='FFFFFF';	// Font color subs when mouse is not over
    var FontHighColor='40156A';	// Font color when mouse is over
    var FontSubHighColor='40156A';	// Font color subs when mouse is over
    var BorderColor='000000';	// Border color
    var BorderSubColor='000000';	// Border color for subs
    var BorderWidth=1;		// Border width
    var BorderBtwnElmnts=1;		// Border between elements 1 or 0
    var FontFamily="Tahoma, Verdana, Arial"	        // Font family menu items
    var FontSize=10;			// Font size menu items
    var FontBold=0;			// 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=1;		// Menu offset x coordinate
    var StartLeft=1;		// 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=1;	// 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='navig';	// Frame where first level appears
    var SecLineFrame='space';	// Frame where sub levels appear
    var DocTargetFrame='space';	// Frame where target documents appear
    var TargetLoc='pos1';		// 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=1;		// 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
    I was thinking that it might be related to this line
    var DocTargetFrame='space';
    but when I change space to, content, then the menu doesn't appear at all.

    Turns out that all i had to do was include
    Code:
     javascript:window.open('page source','frame id');
    in the link.
    Last edited by matthewg; 10-04-2007 at 06:43 PM. Reason: Found a solution

  2. #2
    Join Date
    Feb 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Code:
    <iframe id='content' name='content' ...></iframe>
    Code:
    link1.setAttribute('target', 'content');
    Thats all!

    --------------------
    [Signature Removed by a Moderator - You must have at least 5 posts before having a signature, and no images are allowed.]
    Last edited by tech_support; 10-06-2007 at 09:02 AM.

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
  •