Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

menu/frames help 1

Status
Not open for further replies.

Neenz

Programmer
Nov 6, 2001
6
0
0
US
Argh... I can't get this for the life of me! Ok, I have my menu finally the way I want it, but I can't get the dang links to work. I want it so that when you click on the link in the left frame, the page opens up in the right frame. (It's probably something simple I did a search here, but couldn't find it). Well, here's a link to what I'm talking about. Keep in mind that I don't have the links configured to work right now, cause everything I did didn't work. Thanks for taking the time to look at it for me :)!

 
Put a name attribute to the frame-tag you want to refer to and refer to it by adding a target attribute to the anchor-tag.

E.g.:

Code:
<frame src=&quot;yada.html&quot; name=&quot;gohere&quot;>

and

Code:
<a href=&quot;blabla.html&quot; target=&quot;gohere&quot;>

This way your link will be opened in the 'gohere'-frame. It's not a lie if YOU believe it ;-)
 
Thanks for responding so fast :) Ok, I understand what you're saying, but where in the code would I put this? where it says ('nodemo.htm,'this.id)?
 
You need to add the following line at the end of the newPageSelect function definition in the cool.html file (in the javascript part):

Code:
function newPageSelect(sUrl,sMoveMenuItem)
 {
  // Menu item was selected. Here you can add our own code what to do next when the
  // menu item sMoveMenuItem was selected
  // sUrl contains the url to move to

  var s;
  var iTempLeft;
  if ((sPrevMenuItem != sMoveMenuItem) && ((bRightDone) && (bLeftDone)))
  {
   bPlaying = true;
   if (sPrevMenuItem!=&quot;&quot;)
   {
     iTempLeft=&quot;&quot;
     iTempLeft=document.images(sPrevMenuItem).style.left;
     iMoveLeft=eval(iTempLeft.substring(0,iTempLeft.length-2));
     moveMenuItemBack()
   }
   sMenuItem=sMoveMenuItem;
   s=document.images(sMenuItem).style.left + &quot;&quot;;
   iMoveRight = eval(s.substring(0,s.length-2));
   iMoveBack = iMoveRight;
   moveMenuItem();
   bPlaying = false;
  }
  
  parent.right.location.href=sUrl; // <--- add this line
 }

And in the html part make sure you replace every nodemo.htm instance (inside the onlick events of your image-tags) with the url you'd like to open when the user clicks a menu item. It's not a lie if YOU believe it ;-)
 
Only after your second post I realized that there was a whole bunch of javascript code on your site so my first post obviously wasn't going to help you. It's not a lie if YOU believe it ;-)
 
Ah, perfect! That was just what I was lookin for. It works great. Thank you so much! :D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top