HackerX
07-08-2003, 02:23 PM
Hi I was wondering if you could help me. I have a page with 2 frames, a mainframe and a side navigational frame. In the side frame I have a javascript menu. What I want to do is to make the linked pages go to the main frame or a newwindow and I know that in HTML to do this with AHREF all you have to do is add a target but I tried that with this piece of javascript and it wont work. I also would like to change the font of the text inside the javascript menu and I have not been able to accomplish that like I would in HTML either. I have the whole script of the side frame (below) and in blue is my failed attempts at changing the font and setting a target. Please help me.
Thanks,
Josh
<HTML>
<HEAD>
<SCRIPT LANGUAGE="_JavaScript">
<!-- Begin
function locktrueie(myform){myform.ie.checked=true;}
function lockfalsenet(myform){myform.nets.checked=true;}
function goToURL() { window.location = ""; }
function nochange(mycheckbox)
{
if (mycheckbox.checked == true){mycheckbox.checked = false;}else{mycheckbox.checked = true;}
}
// End -->
</script>
</HEAD>
<BODY>
<style>
. tds
{
background-Color:BLACK;
width:100;
height:20;
text-align:center;
border:1px RED;
font-size:14;
filter:alpha(opacity=45);
-moz-opacity:45%;
cursor:crosshair;
}
</style>
<script language="_javascript">
nOpac = 50
nPlus = 2
nMin = 1
speed = 30
timer = null;
timer2 = null;
var ie5=(document.all && document.getElementById);
var ns6=(!document.all && document.getElementById);
function fadeImg2(teller)
{
apl[teller][1] = "Up";
changes();
}
function fadeImgend2(teller)
{
apl[teller][1] = "Down";
setTimeout("changes()",50);
}
function changes()
{
next_loop = true;
for (i=0;i<apl.length;i++)
{
obj = link_table.rows[i].cells[0];
opacity = apl[i][0]
if (apl[i][1] == "Up")
{
opacity += nPlus;
apl[i][0] = opacity;
if (apl[i][0] > 105)
{apl[i][1] = "";}
else
{next_loop = false;}
nOpac = opacity;
}
else
{
if (apl[i][1] == "Down")
{
opacity -= nMin;
apl[i][0] = opacity;
if (apl[i][0] < 45)
{apl[i][1] = "";}
else
{next_loop = false;}
nOpac = opacity;
}
}
if(ie5){
obj.style.filter="alpha(opacity="+opacity+")";
}
if(ns6){
obj.style.MozOpacity = opacity + '%';
}
}
if (next_loop == false)
{
timer = setTimeout("changes()",speed);
}
else
{
clearTimeout(timer);
}
}
//for each link option you need to make a new Array;
var apl = new Array();
apl[0] = new Array(45,"");
apl[1] = new Array(45,"");
apl[2] = new Array(45,"");
apl[3] = new Array(45,"");
apl[4] = new Array(45,"");
apl[5] = new Array(45,"");
apl[6] = new Array(45,"");
apl[7] = new Array(45,"");
//expl: apl[8] = new Array(45,"");
</script>
<body bgcolor="BLACK">
<BR>
<BR>
<BR>
<table style="border:1px RED; width:130;height:180" cellspacing=0 cellpadding=0>
<tr><td align=center bgcolor=BLACK>
<font size="7" face="bradley hand itc" color=RED><u>B4B</u></font><br>
</td></tr>
<tr><td align=center border=2>
<table cellpadding=0 cellspacing=0 name=link_table id=link_table>
<tr>
<td class="tds" onfiltered="fadeImg2(0)" onfiltered="fadeImgend2(0)" onfiltered="window.location='http://www.b4b.jimxorb.com/forum/index.php';" face="bradley hand itc" style="border:1px solid RED;background-color:BLACK;width:100;text-align:center;color:RED;" target="newwindow">B4B Forum</td>
</tr>
<tr>
<td class="tds" onfiltered="fadeImg2(1)" onfiltered="fadeImgend2(1)" onfiltered="window.location='http://www.the.iwarp.com/downloads.html';" face="bradley hand itc" style="border:1px solid RED;background-color:BLACK;width:100;text-align:center;color:RED;" target="newwindow">Downloads</td>
</tr>
<tr>
<td class="tds" onfiltered="fadeImg2(2)" onfiltered="fadeImgend2(2)" onfiltered="window.location='http://robotarena.tk/';" face="bradley hand itc" style="border:1px solid RED;background-color:BLACK;width:100;text-align:center;color:RED;" target="newwindow">Links</td>
</tr>
<tr>
<td class="tds" onfiltered="fadeImg2(3)" onfiltered="fadeImgend2(3)" onfiltered="window.location='http://www.the.iwarp.com/site.html';" face="bradley hand itc" style="border:1px solid RED;background-color:BLACK;width:100;text-align:center;color:RED;" target="newwindow">About Us</td>
</tr>
<tr>
<td class="tds" onfiltered="fadeImg2(4)" onfiltered="fadeImgend2(4)" onfiltered="window.location='http://www.the.iwarp.com/iamgehost.html';" face="bradley hand itc" style="border:1px solid RED;background-color:BLACK;width:100;text-align:center;color:RED;" target="newwindow">Image Hosts</td>
</tr>
<tr>
<td class="tds" onfiltered="fadeImg2(5)" onfiltered="fadeImgend2(5)" onfiltered="window.location='';" face="bradley hand itc" style="border:1px solid RED;background-color:BLACK;width:100;text-align:center;color:RED;" target="mainFrame"></td>
</tr>
<tr>
<td class="tds" onfiltered="fadeImg2(6)" onfiltered="fadeImgend2(6)" onfiltered="window.location='http://invisionfree.com/forums/Bots4Battle/';" face="bradley hand itc" style="border:1px solid RED;background-color:BLACK;width:100;text-align:center;color:RED;" target="newwindow">B5B Forum</td>
</tr>
<tr>
<td class="tds" onfiltered="fadeImg2(7)" onfiltered="fadeImgend2(7)" onfiltered="window.location='http://teamicer.to-j.com/Forums/';" face="bradley hand itc" style="border:1px solid RED;background-color:BLACK;width:100;text-align:center;color:RED;" target="newwindow">Old Forum</td>
</tr>
</table>
</td></tr></table>
Thanks,
Josh
<HTML>
<HEAD>
<SCRIPT LANGUAGE="_JavaScript">
<!-- Begin
function locktrueie(myform){myform.ie.checked=true;}
function lockfalsenet(myform){myform.nets.checked=true;}
function goToURL() { window.location = ""; }
function nochange(mycheckbox)
{
if (mycheckbox.checked == true){mycheckbox.checked = false;}else{mycheckbox.checked = true;}
}
// End -->
</script>
</HEAD>
<BODY>
<style>
. tds
{
background-Color:BLACK;
width:100;
height:20;
text-align:center;
border:1px RED;
font-size:14;
filter:alpha(opacity=45);
-moz-opacity:45%;
cursor:crosshair;
}
</style>
<script language="_javascript">
nOpac = 50
nPlus = 2
nMin = 1
speed = 30
timer = null;
timer2 = null;
var ie5=(document.all && document.getElementById);
var ns6=(!document.all && document.getElementById);
function fadeImg2(teller)
{
apl[teller][1] = "Up";
changes();
}
function fadeImgend2(teller)
{
apl[teller][1] = "Down";
setTimeout("changes()",50);
}
function changes()
{
next_loop = true;
for (i=0;i<apl.length;i++)
{
obj = link_table.rows[i].cells[0];
opacity = apl[i][0]
if (apl[i][1] == "Up")
{
opacity += nPlus;
apl[i][0] = opacity;
if (apl[i][0] > 105)
{apl[i][1] = "";}
else
{next_loop = false;}
nOpac = opacity;
}
else
{
if (apl[i][1] == "Down")
{
opacity -= nMin;
apl[i][0] = opacity;
if (apl[i][0] < 45)
{apl[i][1] = "";}
else
{next_loop = false;}
nOpac = opacity;
}
}
if(ie5){
obj.style.filter="alpha(opacity="+opacity+")";
}
if(ns6){
obj.style.MozOpacity = opacity + '%';
}
}
if (next_loop == false)
{
timer = setTimeout("changes()",speed);
}
else
{
clearTimeout(timer);
}
}
//for each link option you need to make a new Array;
var apl = new Array();
apl[0] = new Array(45,"");
apl[1] = new Array(45,"");
apl[2] = new Array(45,"");
apl[3] = new Array(45,"");
apl[4] = new Array(45,"");
apl[5] = new Array(45,"");
apl[6] = new Array(45,"");
apl[7] = new Array(45,"");
//expl: apl[8] = new Array(45,"");
</script>
<body bgcolor="BLACK">
<BR>
<BR>
<BR>
<table style="border:1px RED; width:130;height:180" cellspacing=0 cellpadding=0>
<tr><td align=center bgcolor=BLACK>
<font size="7" face="bradley hand itc" color=RED><u>B4B</u></font><br>
</td></tr>
<tr><td align=center border=2>
<table cellpadding=0 cellspacing=0 name=link_table id=link_table>
<tr>
<td class="tds" onfiltered="fadeImg2(0)" onfiltered="fadeImgend2(0)" onfiltered="window.location='http://www.b4b.jimxorb.com/forum/index.php';" face="bradley hand itc" style="border:1px solid RED;background-color:BLACK;width:100;text-align:center;color:RED;" target="newwindow">B4B Forum</td>
</tr>
<tr>
<td class="tds" onfiltered="fadeImg2(1)" onfiltered="fadeImgend2(1)" onfiltered="window.location='http://www.the.iwarp.com/downloads.html';" face="bradley hand itc" style="border:1px solid RED;background-color:BLACK;width:100;text-align:center;color:RED;" target="newwindow">Downloads</td>
</tr>
<tr>
<td class="tds" onfiltered="fadeImg2(2)" onfiltered="fadeImgend2(2)" onfiltered="window.location='http://robotarena.tk/';" face="bradley hand itc" style="border:1px solid RED;background-color:BLACK;width:100;text-align:center;color:RED;" target="newwindow">Links</td>
</tr>
<tr>
<td class="tds" onfiltered="fadeImg2(3)" onfiltered="fadeImgend2(3)" onfiltered="window.location='http://www.the.iwarp.com/site.html';" face="bradley hand itc" style="border:1px solid RED;background-color:BLACK;width:100;text-align:center;color:RED;" target="newwindow">About Us</td>
</tr>
<tr>
<td class="tds" onfiltered="fadeImg2(4)" onfiltered="fadeImgend2(4)" onfiltered="window.location='http://www.the.iwarp.com/iamgehost.html';" face="bradley hand itc" style="border:1px solid RED;background-color:BLACK;width:100;text-align:center;color:RED;" target="newwindow">Image Hosts</td>
</tr>
<tr>
<td class="tds" onfiltered="fadeImg2(5)" onfiltered="fadeImgend2(5)" onfiltered="window.location='';" face="bradley hand itc" style="border:1px solid RED;background-color:BLACK;width:100;text-align:center;color:RED;" target="mainFrame"></td>
</tr>
<tr>
<td class="tds" onfiltered="fadeImg2(6)" onfiltered="fadeImgend2(6)" onfiltered="window.location='http://invisionfree.com/forums/Bots4Battle/';" face="bradley hand itc" style="border:1px solid RED;background-color:BLACK;width:100;text-align:center;color:RED;" target="newwindow">B5B Forum</td>
</tr>
<tr>
<td class="tds" onfiltered="fadeImg2(7)" onfiltered="fadeImgend2(7)" onfiltered="window.location='http://teamicer.to-j.com/Forums/';" face="bradley hand itc" style="border:1px solid RED;background-color:BLACK;width:100;text-align:center;color:RED;" target="newwindow">Old Forum</td>
</tr>
</table>
</td></tr></table>