Rollover / Hover / Mouseover Buy Buttons Help Needed :s

Rob001
Contributor
Contributor

Hey guys, I need to create a rollover button using Dreamweaver CS4 using either HTMl or CSS (dont want Javascript as it can be disabled unless someone suggests valid reason(s) otherwise)

 

I have researched this on the net and on the PayPal forums but to no avail, i have this code so far:

 

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">

<input type="image" src="../_images/BUY-BUTTON.png" border="0" onMouseOver="this.src='../_images/BUY-BUTTON—-Blue.png'" onMouseOut="this.src='../_images/BUY-BUTTON.png'" alt="" name="submit"/>

<input type="hidden" name="cmd" value="_s-xclick">

<input type="hidden" name="hosted_button_id" value="RG74BCA646B78">

<img alt="" border="0" src="../_images/BUY-BUTTON.png" width="1" height="1">

</form>

 

This sort of works but on mouse over the image doesn't appear it just shows that default error / empty image rather than my BUY-BUTTON—-Blue.png image. From all the resaerch the above code works for some people but not me, typical! Anyway if no one can suggest whats wrong perhaps I should use CSS although ive looked for this code too and cant seem to find an appropriate one, any help will be really appreciated Smiley Happy

Rob

Smiley Frustrated

Login to Me Too
7 REPLIES 7

KennyC
Contributor
Contributor

Your code looks a little wrong from here may be cos its 6 am but try this

 

<img src="YOURIMAGELOCATION" onmouseover="this.src='YOURIMAGELOCATION';" onmouseout="YOURIMAGELOCATION';" />

 

Note the ; between ' and "

 

Also if that dont work try changing your mouse over image name

 

Saying all that I think CSS is a far better/cleaner and crisp way of doing it

Login to Me Too

Rob001
Contributor
Contributor

Kenny if you were a woman and not on the net I'd kiss you, just altered the name of the image to BUY-BUTTON-Blue.png and it worked, so simple yet beautiful Smiley Very Happy

Cheers matey youre a star

All the best

Rob

Login to Me Too

PayPal_paula
Moderator
Moderator

Hi Rob001, 

 

Glad you got this resolved. 

 

Paula 

Login to Me Too

PayPal_paula
Moderator
Moderator

Hi KennyC, 

 

I can see from your post that you really know what you are talking about. Thanks for your input and its great to see that you were able to help another member resolve their issue. 

 

Kudos to you

 

Please feel free to come back anytime. 

Paula 

Login to Me Too

Idonotknow
Contributor
Contributor

And is it possible to add a html code that will change the button image when it is CLICKED?

 

Is it doable in html? I cannot make onclick or onmousedown to work. I would not like to go into CSS if not absolutely necessary.

 

Thanks.

Login to Me Too

Idonotknow
Contributor
Contributor

does someone have an idea how to do this??

Login to Me Too

snowshoe
Frequent Advisor
Frequent Advisor

Yes.

<!-- Start mouse over - This line is where the standard commands for the mouse over to change button colors and text-->
<input type="image" src="donate_off.gif" border="0" name="submit" alt="Make a Donation Today!" onmouseover="this.src='donate_on.gif'" onmouseout="this.src='donate_off.gif'">
<!-- Note - the line of code below is the mouse over code itself - it uses two identical graphics but each is a different color -->
<!-- src="donate_off.gif" border="0" onmouseover="this.src='donate_on.gif'" onmouseout="this.src='donate_off.gif'" -->

 

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.