What we need :
- Image which will be acting as the submit button.
- Slightly modified Image of the first one to show some rollover effect.
- HTML codes and some JS code.
<input type="image" src="subscribe.png" />This HTML code uses the subscribe.png as the submit button.
Now we will add some simple rollover effect.
<input type="image" src="subscribe.png" onmouseover="this.src='sub_top.png'" onmouseout="this.src='subscribe.png'"/>We are using small javascript code to change the image of the button whenever the user put the mouse over the button. This adds a nice rollover effect. We added the onmouseover event and then change the image src property of that element. We have to restore the image whenever the button loses focus. This is done by the onmouseout event.
All done. Here is the screen shot of how it looks.
Here is the total work.
If you have any suggestion or question please leave a comment.
nice post....sounds interesting.obviously I'll try this work. but question is will this button work as submit button??? because the input type is 'image' instead of 'submit'.
ReplyDeletesubail sunny
0607030
yes..that good question sunny... ami ota k link hisabe use korsilam.. but post hobe kina eta mathai ase ni... svn plz ans that....
ReplyDeleteShishir
CSE-2K6, KUET