stupid_guy
04-25-2003, 11:34 AM
im trying to combine a rollover image and a link which changes more than a frame at a time so that you move over the link the picture changes and when clicked it changes 2 frames but i can't get it to work! here's the code:
<html>
<head>
<title>navagation</title>
<script language="JavaScript" type="text/javascript">
function SwitchImg()
{
var rem, keep=0, store, obj, switcher=new Array, history=document.Data;
for (rem=0; rem < (SwitchImg.arguments.length-2); rem+=3) {
store = SwitchImg.arguments[(navigator.appName == 'Netscape')?rem:rem+1];
if ((store.indexOf('document.layers[')==0 && document.layers==null) ||
(store.indexOf('document.all[')==0 && document.all==null))
store = 'document'+store.substring(store.lastIndexOf('.'),store.length);
obj = eval(store);
if (obj != null) {
switcher[keep++] = obj;
switcher[keep++] = (history==null || history[keep-1]!=obj)?obj.src:history[keep];
obj.src = SwitchImg.arguments[rem+2];
} }
document.Data = switcher;
}
function RestoreImg()
{
if (document.Data != null)
for (var rem=0; rem<(document.Data.length-1); rem+=2)
document.Data[rem].src=document.Data[rem+1];
}
</script>
</head>
<body bgcolor="#330066">
<br>
(here's the simple rollover link)
<a href="home.html" target="main" onMouseOut="RestoreImg()" onMouseOver="SwitchImg('document.lkhome','document.lkhome','txthome.jpg')"><img src="lkhome.jpg" name="lkhome" width="100%" height="15%" alt="Home" border="0"></a>
(here's the rollover + multipe frame changing link which i can't get to work)
<a href="#"
onClick="parent.main.location='pictures.html'
window.location='picsnav.html';">
onMouseOut="RestoreImg()" onMouseOver="SwitchImg('document.lkpic','document.lkpic','txtpic.jpg')"><img src="lkpic.jpg" name="lkpic" width="100%" height="15%" alt="Pictures" border="0"></a>
hope you got what i meant!
:D
<html>
<head>
<title>navagation</title>
<script language="JavaScript" type="text/javascript">
function SwitchImg()
{
var rem, keep=0, store, obj, switcher=new Array, history=document.Data;
for (rem=0; rem < (SwitchImg.arguments.length-2); rem+=3) {
store = SwitchImg.arguments[(navigator.appName == 'Netscape')?rem:rem+1];
if ((store.indexOf('document.layers[')==0 && document.layers==null) ||
(store.indexOf('document.all[')==0 && document.all==null))
store = 'document'+store.substring(store.lastIndexOf('.'),store.length);
obj = eval(store);
if (obj != null) {
switcher[keep++] = obj;
switcher[keep++] = (history==null || history[keep-1]!=obj)?obj.src:history[keep];
obj.src = SwitchImg.arguments[rem+2];
} }
document.Data = switcher;
}
function RestoreImg()
{
if (document.Data != null)
for (var rem=0; rem<(document.Data.length-1); rem+=2)
document.Data[rem].src=document.Data[rem+1];
}
</script>
</head>
<body bgcolor="#330066">
<br>
(here's the simple rollover link)
<a href="home.html" target="main" onMouseOut="RestoreImg()" onMouseOver="SwitchImg('document.lkhome','document.lkhome','txthome.jpg')"><img src="lkhome.jpg" name="lkhome" width="100%" height="15%" alt="Home" border="0"></a>
(here's the rollover + multipe frame changing link which i can't get to work)
<a href="#"
onClick="parent.main.location='pictures.html'
window.location='picsnav.html';">
onMouseOut="RestoreImg()" onMouseOver="SwitchImg('document.lkpic','document.lkpic','txtpic.jpg')"><img src="lkpic.jpg" name="lkpic" width="100%" height="15%" alt="Pictures" border="0"></a>
hope you got what i meant!
:D