ColinSnow
03-10-2006, 06:45 PM
Hello, I'm trying to figure out how to use TARGET="" inside a JavaScript web menu so it loads in the IFRAME rather then opening a new page.
Here is an example of my menu code just in case:
<SCRIPT language=javascript src="transmenuC.js" type=text/javascript></SCRIPT>
<SCRIPT language=javascript type=text/javascript>
function init() {
if (TransMenu.isSupported()) {
TransMenu.initialize();
menu1.onactivate = function() { document.getElementById("resumes").className = "hover"; };
menu1.ondeactivate = function() { document.getElementById("resumes").className = ""; };
menu2.onactivate = function() { document.getElementById("projects").className = "hover"; };
menu2.ondeactivate = function() { document.getElementById("projects").className = ""; };
}
}
</SCRIPT>
</HEAD>
<BODY bgcolor="white" background="images/bgpat.gif" onload=init()>
<STYLE>TD {
FONT-WEIGHT: normal; FONT-SIZE: 11px; FONT-FAMILY: verdana, arial, sans-serif; TEXT-DECORATION: none
}
</STYLE>
<TABLE cellSpacing=0 cellPadding=0 width=740 align=center border=0>
<TBODY>
<TR>
<TD vAlign=top bgColor=black><!-- table2 -->
<TABLE cellSpacing=0 cellPadding=0 width=740 border=0>
<TBODY>
<TR>
<TD style="PADDING-LEFT: 15px; PADDING-TOP: 3px" vAlign=top><a href="/files/"><IMG
border="0" height=60 src="/files/images/logo.jpg"
width=120></a></TD>
<TD style="PADDING-RIGHT: 4px" vAlign=center align=right rowSpan=2>
<DIV align=right></DIV></TD></TR>
<TR>
<TD style="PADDING-RIGHT: 23px; PADDING-BOTTOM: 4px" align=right><A
href="/files/xfiles/"> </A></TD>
</TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TABLE><TR><TD><!-- table 3 -->
<TABLE cellSpacing=0 cellPadding=0 width=740 align=center border=0>
<TBODY>
<TR>
<TD vAlign=top height=33 rowSpan=2></TD>
<TD style="FONT-SIZE: 12px" bgColor=black colSpan=8 height=15><STRONG><A
href="#"><FONT color=#000000></FONT></A></STRONG></TD>
<TD vAlign=bottom height=33 rowSpan=2></TD>
</TR>
<TR>
<TD class=menu style="BACKGROUND-COLOR: black" align=middle width=112 height=18><div align="center"><A href="welcome.html" TARGET="mainwindow"><FONT color=white><STRONG>Home</STRONG></FONT></A></div></TD>
<TD style="BORDER-LEFT: #e6edf3 1px solid; BACKGROUND-COLOR: black" align=middle width=112 height=18><div align="center"><A href="about.html" TARGET="mainwindow"><FONT color=white><STRONG>About Me</STRONG></FONT></A> </div></TD>
<TD style="BORDER-LEFT: #e6edf3 1px solid; BACKGROUND-COLOR: black" align=middle width=112 height=18><div align="center"><A href="news.html" TARGET="mainwindow"><FONT color=white><STRONG>News</STRONG></FONT></A> </div></TD>
<TD style="BORDER-LEFT: #e6edf3 1px solid; BACKGROUND-COLOR: black" align=middle width=138 height=18><div align="center"><A id=resumes><FONT color=white><STRONG>Resumes</STRONG></FONT></A> </div></TD>
<TD style="BORDER-LEFT: #e6edf3 1px solid; BACKGROUND-COLOR: black" align=middle width=138 height=18><div align="center"><A id=projects><FONT color=white><STRONG>Projects</STRONG></FONT></A> </div></TD>
<TD style="BORDER-LEFT: #e6edf3 1px solid; BACKGROUND-COLOR: black" align=middle width=112 height=18><div align="center"><A href="links.html" TARGET="mainwindow"><FONT color=white><STRONG>Links</STRONG></FONT></A> </div></TD>
<TD style="BORDER-LEFT: #e6edf3 1px solid; BACKGROUND-COLOR: black" align=middle width=112 height=18><div align="center"> <A href="contact.html" TARGET="mainwindow"><FONT color=white><STRONG>Contact Me</STRONG></FONT></A> </div></TD>
</TR>
</TBODY>
</TABLE>
<SCRIPT language=javascript type=text/javascript>
if (TransMenu.isSupported()) {
//================================================== ================================================
var ms = new TransMenuSet(TransMenu.direction.down, 0, 4, TransMenu.reference.bottomLeft);
var menu1 = ms.addMenu(document.getElementById("resumes"));
menu1.addItem("Acting", "");
menu1.addItem("Information Technology", "" );
//================================================== ================================================
var menu2 = ms.addMenu(document.getElementById("projects"));
menu2.addItem("Forums", "forums/phpBB2/index.php");
menu2.addItem("Programing", "");
menu2.addItem("Websites", "");
var submenu0 = menu2.addMenu(menu2.items[0]);
submenu0.addItem("C++", "projects/c++.html");
submenu0.addItem("Java", "projects/Java.html");
self.frames['thatframe'].location.href = 'page.htm';
submenu0.addItem("Visual Basic", "projects/vb.html");
I tried for example submenu0.addItem("Visual Basic", "projects/vb.html" TARGET="iframe_name") but that didn't seem to work. I suppose that is a bit idiotic, but I am semi-new to JavaScript.
I would apreciate any help with this.
UPDATE: Added the rest of the page for you all to reference. I really need help with this guys :(
my site can be found at http://hunter.pinecabin.net/~csnow/
Here is an example of my menu code just in case:
<SCRIPT language=javascript src="transmenuC.js" type=text/javascript></SCRIPT>
<SCRIPT language=javascript type=text/javascript>
function init() {
if (TransMenu.isSupported()) {
TransMenu.initialize();
menu1.onactivate = function() { document.getElementById("resumes").className = "hover"; };
menu1.ondeactivate = function() { document.getElementById("resumes").className = ""; };
menu2.onactivate = function() { document.getElementById("projects").className = "hover"; };
menu2.ondeactivate = function() { document.getElementById("projects").className = ""; };
}
}
</SCRIPT>
</HEAD>
<BODY bgcolor="white" background="images/bgpat.gif" onload=init()>
<STYLE>TD {
FONT-WEIGHT: normal; FONT-SIZE: 11px; FONT-FAMILY: verdana, arial, sans-serif; TEXT-DECORATION: none
}
</STYLE>
<TABLE cellSpacing=0 cellPadding=0 width=740 align=center border=0>
<TBODY>
<TR>
<TD vAlign=top bgColor=black><!-- table2 -->
<TABLE cellSpacing=0 cellPadding=0 width=740 border=0>
<TBODY>
<TR>
<TD style="PADDING-LEFT: 15px; PADDING-TOP: 3px" vAlign=top><a href="/files/"><IMG
border="0" height=60 src="/files/images/logo.jpg"
width=120></a></TD>
<TD style="PADDING-RIGHT: 4px" vAlign=center align=right rowSpan=2>
<DIV align=right></DIV></TD></TR>
<TR>
<TD style="PADDING-RIGHT: 23px; PADDING-BOTTOM: 4px" align=right><A
href="/files/xfiles/"> </A></TD>
</TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TABLE><TR><TD><!-- table 3 -->
<TABLE cellSpacing=0 cellPadding=0 width=740 align=center border=0>
<TBODY>
<TR>
<TD vAlign=top height=33 rowSpan=2></TD>
<TD style="FONT-SIZE: 12px" bgColor=black colSpan=8 height=15><STRONG><A
href="#"><FONT color=#000000></FONT></A></STRONG></TD>
<TD vAlign=bottom height=33 rowSpan=2></TD>
</TR>
<TR>
<TD class=menu style="BACKGROUND-COLOR: black" align=middle width=112 height=18><div align="center"><A href="welcome.html" TARGET="mainwindow"><FONT color=white><STRONG>Home</STRONG></FONT></A></div></TD>
<TD style="BORDER-LEFT: #e6edf3 1px solid; BACKGROUND-COLOR: black" align=middle width=112 height=18><div align="center"><A href="about.html" TARGET="mainwindow"><FONT color=white><STRONG>About Me</STRONG></FONT></A> </div></TD>
<TD style="BORDER-LEFT: #e6edf3 1px solid; BACKGROUND-COLOR: black" align=middle width=112 height=18><div align="center"><A href="news.html" TARGET="mainwindow"><FONT color=white><STRONG>News</STRONG></FONT></A> </div></TD>
<TD style="BORDER-LEFT: #e6edf3 1px solid; BACKGROUND-COLOR: black" align=middle width=138 height=18><div align="center"><A id=resumes><FONT color=white><STRONG>Resumes</STRONG></FONT></A> </div></TD>
<TD style="BORDER-LEFT: #e6edf3 1px solid; BACKGROUND-COLOR: black" align=middle width=138 height=18><div align="center"><A id=projects><FONT color=white><STRONG>Projects</STRONG></FONT></A> </div></TD>
<TD style="BORDER-LEFT: #e6edf3 1px solid; BACKGROUND-COLOR: black" align=middle width=112 height=18><div align="center"><A href="links.html" TARGET="mainwindow"><FONT color=white><STRONG>Links</STRONG></FONT></A> </div></TD>
<TD style="BORDER-LEFT: #e6edf3 1px solid; BACKGROUND-COLOR: black" align=middle width=112 height=18><div align="center"> <A href="contact.html" TARGET="mainwindow"><FONT color=white><STRONG>Contact Me</STRONG></FONT></A> </div></TD>
</TR>
</TBODY>
</TABLE>
<SCRIPT language=javascript type=text/javascript>
if (TransMenu.isSupported()) {
//================================================== ================================================
var ms = new TransMenuSet(TransMenu.direction.down, 0, 4, TransMenu.reference.bottomLeft);
var menu1 = ms.addMenu(document.getElementById("resumes"));
menu1.addItem("Acting", "");
menu1.addItem("Information Technology", "" );
//================================================== ================================================
var menu2 = ms.addMenu(document.getElementById("projects"));
menu2.addItem("Forums", "forums/phpBB2/index.php");
menu2.addItem("Programing", "");
menu2.addItem("Websites", "");
var submenu0 = menu2.addMenu(menu2.items[0]);
submenu0.addItem("C++", "projects/c++.html");
submenu0.addItem("Java", "projects/Java.html");
self.frames['thatframe'].location.href = 'page.htm';
submenu0.addItem("Visual Basic", "projects/vb.html");
I tried for example submenu0.addItem("Visual Basic", "projects/vb.html" TARGET="iframe_name") but that didn't seem to work. I suppose that is a bit idiotic, but I am semi-new to JavaScript.
I would apreciate any help with this.
UPDATE: Added the rest of the page for you all to reference. I really need help with this guys :(
my site can be found at http://hunter.pinecabin.net/~csnow/