View Full Version : disjointed rollover
I'm still trying to make my disjointed rollover work, can someone please help me?
I'm not sure what I'm doing wrong.
I'm new to this and I'm a bit confused on what the holder is suposed to be in this script. what is the best way to do a disjointed rollover text or image rollover?
I can't seem to make the script blow work.
<!--
//JavaScript Disjointed Text Links
//copyright © 2000 - 2003, Dax Assist
//visit http://www.daxassist.com for this and other javascripts
with full tutorials.
if(document.images) {
pics = new Array();
pics[1] = new Image();
pics[1].src = "clear.gif";
pics[2] = new Image();
pics[2].src = "pic1.gif";
pics[3] = new Image();
pics[3].src = "pic2.gif";
}
function changer(from,to) {
if(document.images) {
document.images[from].src = pics[to].src;
}
}
//-->
</SCRIPT>
<img name="holder" id="holder" src="clear.gif" alt="Holder"
width="96" height="87" hspace="30" border="0">
<a href="javascript:;" onMouseOver="changer('holder',2)"
onMouseOut="changer('holder',1)">Text Link 1</a>
coothead
03-04-2006, 06:05 PM
Hi there nali,
try it like this...
<script type="text/javascript">
<!--
//JavaScript Disjointed Text Links
//copyright © 2000 - 2003, Dax Assist
//visit http://www.daxassist.com for this and other javascripts with full tutorials.
if(document.images) {
pics = new Array();
pics[1] = new Image();
pics[1].src = "clear.gif";
pics[2] = new Image();
pics[2].src = "pic.gif";
pics[3] = new Image();
pics[3].src = "pic2.gif";
}
function changer(from,to) {
if(document.images) {
document.images[from].src = pics[to].src;
}
}
//-->
</script>
<img name="holder" id="holder" src="clear.gif" alt="Holder" width="96" height="87" hspace="30" border="0">
<a href="#" onmouseover="changer('holder',2)" onmouseout="changer('holder',1)">Text Link 1</a>
this is my version of it, what is wrong here?
<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
<!--
//JavaScript Disjointed Text Links
//copyright © 2000 - 2003, Dax Assist
//visit http://www.daxassist.com for this and other javascripts
with full tutorials.
if(document.images) {
pics = new Array();
pics[1] = new Image();
pics[1].src = "images/tree5.gif";
pics[2] = new Image();
pics[2].src = "images/tree6.gif";
pics[3] = new Image();
pics[3].src = "images/tree7.gif";
}
function changer(from,to) {
if(document.images) {
document.images[from].src = pics[to].src;
}
}
//-->
</SCRIPT>
<img name="holder" id="holder" src="images/tree5.gif" alt="holder"
width="96" height="87" hspace="30" border="0">
<a href="javascript:;" onMouseOver="changer('holder',2)"
onMouseOut="changer('holder',1)">tree link</a>
I got it to work like that, thank you very much.
the only difference I see is this line....
<a href="javascript:;" onMouseOver="changer('holder',2)"
onMouseOut="changer('holder',1)">tree link</a>
and athis line.....
<a href="#" onmouseover="changer('holder',2)" onmouseout="changer('holder',1)">Text Link 1</a>
what exactly did that do? if you don't mind explaining a bit so that in the future I can overcome such problems I would greatly appreciate it.
coothead
03-05-2006, 03:08 AM
Hi there nali,
what exactly did that do? If you don't mind explaining a bit, so that in the
future I can overcome such problems, I would greatly appreciate it.
I am sorry that, I forgot to say what was the cause of the script failure. :supereek:
It was this...
with full tutorials.
...which was not commented out, so I just moved it up to the line above thus...
//visit http://www.daxassist.com for this and other javascripts with full tutorials.
My change of this...
<a href="javascript:;" onMouseOver="changer('holder',2)" onMouseOut="changer('holder',1)">tree link</a>
...to this...
<a href="#" onmouseover="changer('holder',2)" onmouseout="changer('holder',1)">Text Link 1</a>
...was really only cosmetic and did not effect the working of the script at all. I have been programmed to only accept
lower case code, hence the disappearance of the 'M' and the 'O'. :loopy:
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.