Help with Image Button needed please.

liunx

Guest
G'day mates,<br />
<br />
I am trying to create the effect of A image distorting when either, a mouse hovers over it, or it is clicked on. <br />
<br />
I am useing the Coffee Cup HTML editor and came across this Script, but alas I cannot get it to work :(<br />
<br />
Here is the original script;<br />
<br />
(!-- Changes an image when clicked on, cool for action <br />
i.e. button-then pushed button--)<br />
<br />
(script language="JavaScript")<br />
up = new Image(32,32);<br />
up.src = <!-- m --><a class="postlink" href="http://www.htmlforums.com/archive/index.php/">http://www.htmlforums.com/archive/index.php/</a><!-- m -->"active1.gif";<br />
down = new Image(32,32);<br />
down.src = <!-- m --><a class="postlink" href="http://www.htmlforums.com/archive/index.php/">http://www.htmlforums.com/archive/index.php/</a><!-- m -->"disabled1.gif";<br />
<br />
function switchThis() { document.coffee.src=http://www.htmlforums.com/archive/index.php/up.src; }<br />
(/script)<br />
<br />
(A HREF = <!-- m --><a class="postlink" href="http://www.htmlforums.com/archive/index.php/">http://www.htmlforums.com/archive/index.php/</a><!-- m -->"javascript:switchThis()"<br />
onMouseClick="document.coffee.src=http://www.htmlforums.com/archive/index.php/up.src"<br />
onMouseOut="document.coffee.src=http://www.htmlforums.com/archive/index.php/down.src")<br />
(IMG NAME = "coffee" border=0 SRC = <!-- m --><a class="postlink" href="http://www.htmlforums.com/archive/index.php/">http://www.htmlforums.com/archive/index.php/</a><!-- m -->"active1.gif")(/A)<br />
<br />
<br />
Here is my attempt; :rolleyes: <br />
<br />
(script language="JavaScript")<br />
up = new Image(64,76);<br />
up.src = <!-- m --><a class="postlink" href="http://www.htmlforums.com/archive/index.php/">http://www.htmlforums.com/archive/index.php/</a><!-- m -->"http://shroomstrlestuff.aokwebhost4free.com/Images/letricbutton.gif";<br />
down = new Image(64,76);<br />
down.src = <!-- m --><a class="postlink" href="http://www.htmlforums.com/archive/index.php/">http://www.htmlforums.com/archive/index.php/</a><!-- m -->"http://shroomstrlestuff.aokwebhost4free.com/Images/letricbutton2.gif";<br />
<br />
function switchThis() { document.lara.src=http://www.htmlforums.com/archive/index.php/up.src; }<br />
<br />
(/script)<br />
<br />
(A HREF =http://www.htmlforums.com/archive/index.php/"http://shroomstrlestuff.aokwebhost4free.com/Objects/arty%20gun.zip"<br />
onMouseClick="http://shroomstrlestuff.aokwebhost4free.com/Images/letricbutton2.gif"<br />
onMouseOut="http://shroomstrlestuff.aokwebhost4free.com/Images/letricbutton2.gif")<br />
(IMG NAME = "lara" border=0 SRC = <!-- m --><a class="postlink" href="http://www.htmlforums.com/archive/index.php/">http://www.htmlforums.com/archive/index.php/</a><!-- m -->"http://shroomstrlestuff.aokwebhost4free.com/Images/letricbutton.gif")(/A)<br />
<br />
<br />
Here are the 2 images, 1st the one I want to be the main image; <!-- m --><a class="postlink" href="http://shroomstrlestuff.aokwebhost4free.com/Images/letricbutton.gif">http://shroomstrlestuff.aokwebhost4free ... button.gif</a><!-- m --> <br />
<br />
Next the Distorted version that I want to appear when the mouse Hovers over, or clicks on it; <!-- m --><a class="postlink" href="http://shroomstrlestuff.aokwebhost4free.com/Images/letricbutton2.gif">http://shroomstrlestuff.aokwebhost4free ... utton2.gif</a><!-- m --> <br />
<br />
Here is the Page with what happens, ie- Nothing:confused: My page (<!-- m --><a class="postlink" href="http://underworld.aokwebhost4free.com/objects.html">http://underworld.aokwebhost4free.com/objects.html</a><!-- m -->) <br />
<br />
So can any one tell me what I am doing wrong? or know of a similar script?<br />
<br />
Cheers in Advance<br />
Shroom<!--content-->Doh! now the pictures didnt load I will try the attach files thingie hehe :newbie: this is the distorted image I want to use for hover and clicking<!--content-->=:O<!--content-->At last here it is, this is the image I want to use as the main Image.<br />
<br />
Soory about all the posts:dunce:<!--content-->Nice tutorial!<!--content-->Hehehe Actually I need some help I think I have written somthing wrong, or in the wrong order, because it wont get the Distorted look when the Mouse is hovered or clicked on the Button:( <br />
<br />
Thx anyway, but if anyone know how to get this to work, I would love to know<br />
<br />
Cheers<br />
Shroom<!--content-->
 
Back
Top