/    Sign up×
Community /Pin to ProfileBookmark

HV menu question

I am using the script found [URL=http://dynamicdrive.com/dynamicindex1/hvmenu/index.htm]Here[/URL] to create a menu for our website. Now my question is… I want the buttons on in the menu to open up the links in a different iframe. How would I go about changing it so the links all load into the iframe?

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@ray326Dec 31.2003 — Given something like:

<iframe id="myframe" src=""></iframe>

You can load something into it like so:

document.getElementById("myframe").src="a_local_page.htm"
Copy linkTweet thisAlerts:
@fredmvDec 31.2003 — If it's the first frame in the document:frames[0].location = 'foo.html';
Copy linkTweet thisAlerts:
@liegiaauthorDec 31.2003 — where would i insert it into this code:

Menu2=new Array("Shows","blank.htm","",2);

Menu2_1=new Array("Current Shows","blank.htm","",0,20,150);

Menu2_2=new Array("Past Shows","blank.htm","",0);



whereas, MenuX=new Array(Text to show, Link, background image (optional), number of sub elements, height, width);
Copy linkTweet thisAlerts:
@ray326Dec 31.2003 — My first cut would be:

Menu2=new Array("Shows","javascript:getElementById('fid').src='blank.htm'","",2);

If that proved out then I'd factor it out into a function so it would become:

Menu2=new Array("Shows","javascript:return showpage('blank.htm')","",2);

And I'd have showpage() return false.

OR I'd rewrite some bit of the menuing code to handle the menu link more directly.

In fact, if it were me I'd do the latter. 8-)
Copy linkTweet thisAlerts:
@liegiaauthorJan 02.2004 — function Check(WMnu,NoOf){

var i,array,ArrayLoc;

ArrayLoc=parent.frames[0]?parent.frames[FirstLineFrame]:self;

for(i=0;i<NoOf;i++){

array=WMnu+eval(i+1);

if(!ArrayLoc[array]){WbMstrAlrt(0,array); return false}

if(i==0){ if(!ArrayLoc[array][4]){WbMstrAlrt(1,array); return false}

if(!ArrayLoc[array][5]){WbMstrAlrt(2,array); return false}}

if(ArrayLoc[array][3])if(!Check(array+'_',ArrayLoc[array][3])) return false}

return true}

function WbMstrAlrt(No,Xtra){

return confirm(WbMstrAlrts[No]+Xtra+' ')}

function Go(){

Dummy();

if(Loadd||!PosStrt)return;

BeforeStart();

Creatd=0; Loadd=1;

status='Building menu';

if(FirstLineFrame =="" || !parent.frames[FirstLineFrame]){

FirstLineFrame=SecLineFrame;

if(FirstLineFrame =="" || !parent.frames[FirstLineFrame]){

FirstLineFrame=SecLineFrame=DocTargetFrame;

if(FirstLineFrame =="" || !parent.frames[FirstLineFrame])FirstLineFrame=SecLineFrame=DocTargetFrame=''}}

if(SecLineFrame =="" || !parent.frames[SecLineFrame]){

SecLineFrame=DocTargetFrame;




The above replies havent gotten my desired results. I'm new to coding, so this may seem dumb. But would this be where i can edit the menu to link to my target frame. And if so, where would i go about doing this
Copy linkTweet thisAlerts:
@ray326Jan 03.2004 — Line 261 in menu_com.js looks particularly interesting.
Copy linkTweet thisAlerts:
@liegiaauthorJan 04.2004 — found the conflict in exmplmenu_var.js... it works great now.
×

Success!

Help @liegia spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...