...

View Full Version : HELP: Frames not working with rollovers



Crimson
08-27-2002, 02:32 PM
<HEAD>
<SCRIPT>
<!--
// Handles rollover images for NN3+ and IE4+
var loaded = new Array();

function F_loadRollover(image,imageName) {
if (image && image.src &&
(null == image.out || typeof(image.out) == typeof(void(0)))) {
s = image.src;
image.out = new Image();
image.out.src = s;
image.over = new Image();
if (imageName.lastIndexOf('/') >= 0 || imageName.lastIndexOf('\\') >=0) {
s = imageName;
} else {
i = s.lastIndexOf('/');
if (i<0) i = s.lastIndexOf('\\');
if (i<0) { s = imageName; }
else { s = s.substring(0,i+1) + imageName; }
}
image.over.src = s;
loaded[image.name] = image;
}
}
function F_roll(imageName,over) {
if (document.images) {
if (over) { imageObject = "over"; }
else { imageObject = "out"; }
image = loaded[imageName];
if (image) {
ref = eval("image."+imageObject);
if (ref) image.src = eval("image."+imageObject+".src");
}
if (window.event)
window.event.cancelBubble = true;
}
}
//-->
</SCRIPT>
</HEAD>

<A HREF="/pc.html" TARGET="Index" onMouseOver="F_roll('PC',1)"
onMouseOut="F_roll('PC',0)">
<IMG NAME="PC" SRC="/pc_off.gif"
onLoad="F_loadRollover(this,'/pc_on.gif')" BORDER=0
ALT="PC"></A><BR>

The above is what I used and it's not working with the rollovers. The left frame is called "Side", and the right frame is called "Index". So I got the windows name right.

I tried doing it w/o the rollovers, and it worked fine. So I'm sure it's the rollovers causing the problem.

What can I do to keep the frame and rollovers? I know I can do it w/o frames, but I need the left frame since I'm adding in music on the background. If I do it all in one page, the music will reset each time you log into a different page. And I want to keep the rollovers since they allow me to see a different pic when I highlight the link.

All help given will be appreciated. Thanks.

Crimson
08-27-2002, 02:46 PM
Never mind. I found an alternative, MouseOver. Thanks anyways.

I got a question, though. What's the different between RollOver and MouseOver? They do the same thing as far as I see it, but why do they have different scripts? There must be something different between them.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum