View Full Version : Need Help with Javascripts in Header Insert
Littlebit
11-22-2002, 04:53 PM
I'm having trouble getting my hacked header insert to work properly. Could someone give me a hand cleaning up my code if I pm my insert for a look? :nervous:
Littlebit
12-11-2002, 07:35 PM
My problem is in my header insert, this is being ignored with latest IE for macOSX:
A:link, A:visited, A:active {
COLOR: {linkcolor};
}
A:hover {
COLOR: {hovercolor};
}
#cat A:link, #cat A:visited, #cat A:active {
COLOR: {categoryfontcolor};
TEXT-DECORATION: none;
}
#cat A:hover {
COLOR: {categoryfontcolor};
TEXT-DECORATION: underline;
}
#ltlink A:link, #ltlink A:visited, #ltlink A:active {
COLOR: {linkcolor};
TEXT-DECORATION: none;
}
#ltlink A:hover {
COLOR: {hovercolor};
TEXT-DECORATION: underline;
}
Littlebit
12-11-2002, 07:39 PM
I've a script from the store hack 2.0 and the scripts for my rollovers in toplinks. Is there anything that could be producing an error that would effect certain browsers only that someone can see? :chinese: If anyone can take a look, here is what I have in the header insert:
<meta http-equiv="MSThemeCompatible" content="Yes">
<script LANGUAGE="javascript">
<!--
function showwin(name,size)
{
attrbts = size + ",resizable=yes,toolbar=no,location=no,directories= no,status=no,menubar=no,scrollbars=yes"
window.open(name, "Photos", attrbts);
}
//-->
</script>
<style type="text/css">
BODY {
SCROLLBAR-BASE-COLOR: {categorybackcolor};
SCROLLBAR-ARROW-COLOR: {categoryfontcolor};
}
SELECT {
FONT-FAMILY: Verdana,Arial,Helvetica,sans-serif;
FONT-SIZE: 11px;
COLOR: #000000;
BACKGROUND-COLOR: #CFCFCF
}
TEXTAREA, .bginput {
FONT-SIZE: 12px;
FONT-FAMILY: Verdana,Arial,Helvetica,sans-serif;
COLOR: #000000;
BACKGROUND-COLOR: #CFCFCF
}
A:link, A:visited, A:active {
COLOR: {linkcolor};
}
A:hover {
COLOR: {hovercolor};
}
#cat A:link, #cat A:visited, #cat A:active {
COLOR: {categoryfontcolor};
TEXT-DECORATION: none;
}
#cat A:hover {
COLOR: {categoryfontcolor};
TEXT-DECORATION: underline;
}
#ltlink A:link, #ltlink A:visited, #ltlink A:active {
COLOR: {linkcolor};
TEXT-DECORATION: none;
}
#ltlink A:hover {
COLOR: {hovercolor};
TEXT-DECORATION: underline;
}
.thtcolor {
COLOR: {tableheadtextcolor};
}
</style>
<script type="text/javascript">
<!--
function newImage(arg) {
if (document.images) {
rslt = new Image();
rslt.src = arg;
return rslt;
}
}
function changeImages() {
if (document.images && (preloadFlag == true)) {
for (var i=0; i<changeImages.arguments.length; i+=2) {
document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
}
}
}
// -->
</script>
<script type="text/javascript"><!--
var preloadFlag = false;
function preloadImages() {
if (document.images) {
over_RolloverImage = newImage(/*URL*/'{imagesfolder}/red_home.gif');
over_RolloverImage2 = newImage(/*URL*/'{imagesfolder}/red_swag.gif');
over_RolloverImage3 = newImage(/*URL*/'{imagesfolder}/red_calendar.gif');
over_RolloverImage4 = newImage(/*URL*/'{imagesfolder}/red_members.gif');
over_RolloverImage5 = newImage(/*URL*/'{imagesfolder}/red_faq.gif');
over_RolloverImage6 = newImage(/*URL*/'{imagesfolder}/top_search.gif');
over_RolloverImage7 = newImage(/*URL*/'{imagesfolder}/red_logout.gif');
preloadFlag = true;
}
}
// --></script>
<body onload="preloadImages();">
$headnewpm
NTLDR
12-12-2002, 01:35 PM
For starters I know the body tag should be removed and you need to place: onload="preloadImages();" into the <body> replacement for the style(s).
Littlebit
12-12-2002, 02:23 PM
NTLDR,
Thank you for making me feel not so alone anymore :)
I've taken you suggestion and made it so the body tag looks like this:
<body bgcolor="#000000" text="#ffffff" id="all" leftmargin="1" onload="preloadImages();"
I removed body onload part from header insert.
The rollovers function great and refresh is certainly quicker (thank you)...but in IE, its still default colors for links. ANything else that could be causing this? Do I need to give a TYPE to the LANGUAGE for the first javascript (Store hack one)?
Littlebit
12-12-2002, 02:25 PM
Here's the header insert now:
<meta http-equiv="MSThemeCompatible" content="Yes">
<script LANGUAGE="javascript">
<!--
function showwin(name,size)
{
attrbts = size + ",resizable=yes,toolbar=no,location=no,directories= no,status=no,menubar=no,scrollbars=yes"
window.open(name, "Photos", attrbts);
}
//-->
</script>
<style type="text/css">
BODY {
SCROLLBAR-BASE-COLOR: {categorybackcolor};
SCROLLBAR-ARROW-COLOR: {categoryfontcolor};
}
SELECT {
FONT-FAMILY: Verdana,Arial,Helvetica,sans-serif;
FONT-SIZE: 11px;
COLOR: #000000;
BACKGROUND-COLOR: #CFCFCF
}
TEXTAREA, .bginput {
FONT-SIZE: 12px;
FONT-FAMILY: Verdana,Arial,Helvetica,sans-serif;
COLOR: #000000;
BACKGROUND-COLOR: #CFCFCF
}
A:link, A:visited, A:active {
COLOR: {linkcolor};
}
A:hover {
COLOR: {hovercolor};
}
#cat A:link, #cat A:visited, #cat A:active {
COLOR: {categoryfontcolor};
TEXT-DECORATION: none;
}
#cat A:hover {
COLOR: {categoryfontcolor};
TEXT-DECORATION: underline;
}
#ltlink A:link, #ltlink A:visited, #ltlink A:active {
COLOR: {linkcolor};
TEXT-DECORATION: none;
}
#ltlink A:hover {
COLOR: {hovercolor};
TEXT-DECORATION: underline;
}
.thtcolor {
COLOR: {tableheadtextcolor};
}
</style>
<script type="text/javascript">
<!--
function newImage(arg) {
if (document.images) {
rslt = new Image();
rslt.src = arg;
return rslt;
}
}
function changeImages() {
if (document.images && (preloadFlag == true)) {
for (var i=0; i<changeImages.arguments.length; i+=2) {
document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
}
}
}
// -->
</script>
<script type="text/javascript"><!--
var preloadFlag = false;
function preloadImages() {
if (document.images) {
over_RolloverImage = newImage(/*URL*/'{imagesfolder}/red_home.gif');
over_RolloverImage2 = newImage(/*URL*/'{imagesfolder}/red_swag.gif');
over_RolloverImage3 = newImage(/*URL*/'{imagesfolder}/red_calendar.gif');
over_RolloverImage4 = newImage(/*URL*/'{imagesfolder}/red_members.gif');
over_RolloverImage5 = newImage(/*URL*/'{imagesfolder}/red_faq.gif');
over_RolloverImage6 = newImage(/*URL*/'{imagesfolder}/top_search.gif');
over_RolloverImage7 = newImage(/*URL*/'{imagesfolder}/red_logout.gif');
preloadFlag = true;
}
}
// --></script>
$headnewpm
Littlebit
12-12-2002, 02:57 PM
I just noticed my body tag had some stuff missing! Here's my body tag now:
<body bgcolor="#000000" text="#ffffff" id="all" leftmargin="10" topmargin="10" marginwidth="10" marginheight="10" link="#ffffff" vlink="#ffffff" alink="#ffffff"onload="preloadImages();">
Now the links aren't going to default, just the hover color isn't working. I feel like I'm getting closer. Talking to myself ...:rolleyes: no laughing :p
NTLDR
12-12-2002, 03:09 PM
In the body tag alink should be alink="#000000" to match the value in the CSS :)
Littlebit
12-12-2002, 03:22 PM
I changed it , but the hover still won't work in IE. Works in Netscape (go figure)
I really really want to tahnk you again for just responding...let alone fixing my stuff
NTLDR
12-12-2002, 03:36 PM
Is it IE in Windows? Or is it the Mac/UNIX version of it? The A:hover part of the CSS works fine for me on my boards.
Littlebit
12-12-2002, 03:41 PM
Its IE on my Mac.
the hover part is reading fine for Netscape (mac)
will you see if it is functioning fine on windows IE for me?
the hover color is red
NTLDR
12-12-2002, 03:53 PM
It doesn't work on Windows IE6 either which is odd, I can't see anything wrong with the CSS or the body tag that would be causing this either.
Littlebit
12-12-2002, 03:55 PM
to add, the hover was working with the Mac/unix based IE browser prior to me adding the javascript above <style type="text/css">
I original moved that script below the <style></style>, the link colors worked again, but the script ceased functioning.
Don't know if this information helps anything or not :confused:
Littlebit
12-12-2002, 03:58 PM
whats netscape picking up on... that IE is ignoring with css? What other areas could I look at that may help?
the forums are still not available to public...if you want to look deeper I certainly will give you access...anything to help you help me. I've been dealing with trying to figure this out for weeks now and was almost giving up when you graciously offered advice.:)
NTLDR
12-12-2002, 04:00 PM
Try putting it under the CSS part again but use the following to start the Javascript:
<script language="javascript" type="text/javascript">
May make a difference, may not, but it can't do any harm to try ;)
Littlebit
12-12-2002, 04:07 PM
Okay. I did that, but no hover...BUT! the script now functions under the style! thats at least progress. Did I accidently delete something somewhere and now the hover is messed up for other reasons now maybe?
do I need ahover in the body tag too?...no because thats all in the css style stuff....shoot
Littlebit
12-13-2002, 03:48 PM
If you find out anything down the road about rollover being ignored, please let me know.
I'm happy at least that the default link color is no longer a problem anymore! Thank you NTLDR :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.