Click to See Complete Forum and Search --> : javascript target tag?
I'm working on a site, but I really lost it by now!
the page is split up in 2 frames, one frame has a menu, the other frame is supposed to change if you click a link in the menu. But the new page, when you click a menu link, opens in the menu frame. I need something like a target tag, like in html, but I don't know very much about javascript.
I've uploaded the menu frame, it works with a css and a js file (also uploaded). I did not upload the bottom frame, because I had to upload lots of graphics and other stuff when I wanted to do that.
http://www.geocities.com/turboknol/menuuu.htm
(ehhh, my english is veeeerry bad, I'm a dutch girl :p )
please help me!!
khalidali63
04-18-2003, 02:39 PM
int menu frame you do have links right?which are clicked and then they open in the same frame?
in those links add attribute target="frameName"
I hope I understood your question correctly..
:D
DrDaMour
04-18-2003, 02:40 PM
the page you supplied has only 1 frame.
If you need to add an inset fram, the tag is
<iframe name="myiframe" src="url"/>
then any links that are supposed to load in taht frame are targeted to myiframe
like so
<a href="url" target="myiframe">link</a>
I know the page has only one frame, I didnt upload the rest of it. (it also has a frameset page and a bottom page) I'm creating this site for somebody else, and when its ready it will be uploaded to another domain
the target='framename' doesn't work, I've already tried that
DrDaMour
04-18-2003, 02:51 PM
well you have some bad punctuation or spelling or something, because it DOES work, so you'll need to post all the pages if you want anyone to check what you're dong wrong.
full page (without graphics, it looks really ugly)
http://www.geocities.com/turboknol/set1.htm
khalidali63
04-18-2003, 03:17 PM
in the cascademenu.js file look for thsi function
function Do(obj)
{
var cmd = eval(obj).cmd
window.navigate(cmd)
}
and replace it with this one
function Do(obj) {
var cmd = eval(obj).cmd
//window.navigate(cmd)
parent.frame1.src = cmd;
}
prety sure this will do it
:D
DrDaMour
04-18-2003, 03:26 PM
in your casscademenu.js there is this function
function Do(obj)
{
var cmd = eval(obj).cmd
window.navigate(cmd)
}
change it to
function Do(obj)
{
var cmd = eval(obj).cmd
var fra = eval(obj).target
parent.frames[fra].location.href = cmd;
}
and then in every menu itme to target="Frame1" and watch your capitalization!
DrDaMour
04-18-2003, 03:27 PM
ha, khal mine was better, nah nah nah nah, and she had her frames names Frame1 & Frame2 not frame1 & frame2...
TNX!! you guys are great!:D
okay... I've changed it, and the links open in the right frame now... but the submenus don't open under the menu, but next to it... that happens all the time when I change something in the js file... is that some kind of protection code or something?:confused: