• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts2 submit button rollover

 
Bill Zelan
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,
i have a struct2 submit tag (s:submit) of type='image '. how do i implement rollover?

i tried the javascript way, but i am not able to change the image when the mouse hovers.
below is the code

<script language="JavaScript" type="text/javascript">
<!--
if (document.images) {
buttonup = new Image();
buttonup.src = "images/greenArrow.PNG" ;
buttondown = new Image() ;
buttondown.src = "images/blueArrow.PNG" ;
}
function buttondown( buttonname )
{
if (document.images) {
document[ buttonname ].src = eval( buttonname + "down.src" );
}
}
function buttonup ( buttonname )
{
if (document.images) {
document[ buttonname ].src = eval( buttonname + "up.src" );
}
}
// -->
</script>





the struct tag in the body

<s:submit onmouseover="buttondown('button')" onmouseout="buttonup('button')" id="arrow" type="image" src="images/greenArrow.PNG" />
 
Ankit Garg
Sheriff
Posts: 9519
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bill please Use Code Tags when you post a source code. That way your code looks formatted. Unformatted code is hard to read. You can add code tags by wrapping your code in [code] [/code] tags. You can edit your message using button and then add code tags to it.

Look at a tutorial like this for what you want to do with the image button...
 
Bill Zelan
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok ankit.

javascript




the struct tag in the body

 
Bill Zelan
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks ankit.
its solved

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic