JohnKrutsch
09-03-2002, 05:22 PM
Ok, at work I have to use a gimpy content managemnt system. It generates most of the layout and allows you to do very little to customize the pages. In one instance they generate a menu with some horrid colors and font faces and it is always the same garbarge no matter what the rest of the pages look like I have control of a frame just bellow this one and want to change the style of the links in the ugly frame. Here is what I am trying:
function doit(){
var x=top.uglyFrame.document.getElementsByTagName('a');
for(var i=0;i<x.length;i++){
x[i].setAttribute("style","color:green; background-color:orange")
}
}
the page in the ugly frame looks like this:
<STYLE TYPE='text/css'>
<!--
A:link {
color:#003399;
text-decoration:none;
font-weight:400;font-size:10pt;line-height:10pt;
font-family:helvetica,arial,sans-serif;
}
A:visited {
color:#003399;
text-decoration:none;
font-weight:400;font-size:10pt;line-height:10pt;
font-family:helvetica,arial,sans-serif;
}
A:active {
color:#003399;
text-decoration:none;
font-weight:400;font-size:10pt;line-height:10pt;
font-family:helvetica,arial,sans-serif;
}
A.nav:link {
color:#003399;
text-decoration:none;
background-color:#CCCC99;
font-weight:400;font-size:10pt;line-height:10pt;
font-family:helvetica,arial,sans-serif;
}
A.nav:visited {
color:#003399;
text-decoration:none;
background-color:#CCCC99;
font-weight:400;font-size:10pt;line-height:10pt;
font-family:helvetica,arial,sans-serif;
}
A.nav:active {
color:#003399;
text-decoration:none;
background-color:#CCCC99;
font-weight:400;font-size:10pt;line-height:10pt;
font-family:helvetica,arial,sans-serif;
}
.menu {
color:#000000;
text-decoration:none;
background-color:#CCCCCC;
font-weight:400;font-size:10pt;line-height:10pt;
font-family:helvetica,arial,sans-serif;
}
-->
</STYLE>
<BODY BGCOLOR="#FFFFFF">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"><TR><TD HEIGHT="2"></TD></TR></TABLE>
<TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0"><TR><TD>
<FONT CLASS="menu">ACTION MENU:</FONT>
<A CLASS="nav" HREF="prev.php">Previous</A>
<A CLASS="nav" HREF="next.php">Next</A>
<A CLASS="nav" HREF="cont.php">Contents</A>
<A CLASS="nav" HREF="retr.php">Retrace</A>
<FORM NAME="titles_form">
<INPUT TYPE="HIDDEN" NAME="courselogo_html" VALUE="Overriding the Course Logo">
<INPUT TYPE="HIDDEN" NAME="myavatar_html" VALUE="Using an Avatar">
<input type="button" onclick="doit()" value="test">
</FORM>
So I need to overwirte those styles in order to match the rest of the site. Keep in mind that I don't have any access to the ugly frame.
Any ideas?
function doit(){
var x=top.uglyFrame.document.getElementsByTagName('a');
for(var i=0;i<x.length;i++){
x[i].setAttribute("style","color:green; background-color:orange")
}
}
the page in the ugly frame looks like this:
<STYLE TYPE='text/css'>
<!--
A:link {
color:#003399;
text-decoration:none;
font-weight:400;font-size:10pt;line-height:10pt;
font-family:helvetica,arial,sans-serif;
}
A:visited {
color:#003399;
text-decoration:none;
font-weight:400;font-size:10pt;line-height:10pt;
font-family:helvetica,arial,sans-serif;
}
A:active {
color:#003399;
text-decoration:none;
font-weight:400;font-size:10pt;line-height:10pt;
font-family:helvetica,arial,sans-serif;
}
A.nav:link {
color:#003399;
text-decoration:none;
background-color:#CCCC99;
font-weight:400;font-size:10pt;line-height:10pt;
font-family:helvetica,arial,sans-serif;
}
A.nav:visited {
color:#003399;
text-decoration:none;
background-color:#CCCC99;
font-weight:400;font-size:10pt;line-height:10pt;
font-family:helvetica,arial,sans-serif;
}
A.nav:active {
color:#003399;
text-decoration:none;
background-color:#CCCC99;
font-weight:400;font-size:10pt;line-height:10pt;
font-family:helvetica,arial,sans-serif;
}
.menu {
color:#000000;
text-decoration:none;
background-color:#CCCCCC;
font-weight:400;font-size:10pt;line-height:10pt;
font-family:helvetica,arial,sans-serif;
}
-->
</STYLE>
<BODY BGCOLOR="#FFFFFF">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"><TR><TD HEIGHT="2"></TD></TR></TABLE>
<TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0"><TR><TD>
<FONT CLASS="menu">ACTION MENU:</FONT>
<A CLASS="nav" HREF="prev.php">Previous</A>
<A CLASS="nav" HREF="next.php">Next</A>
<A CLASS="nav" HREF="cont.php">Contents</A>
<A CLASS="nav" HREF="retr.php">Retrace</A>
<FORM NAME="titles_form">
<INPUT TYPE="HIDDEN" NAME="courselogo_html" VALUE="Overriding the Course Logo">
<INPUT TYPE="HIDDEN" NAME="myavatar_html" VALUE="Using an Avatar">
<input type="button" onclick="doit()" value="test">
</FORM>
So I need to overwirte those styles in order to match the rest of the site. Keep in mind that I don't have any access to the ugly frame.
Any ideas?