开发者

Highlight image on tab change

I need your help. I need to highlight image ju开发者_C百科st by dotted line on tab change means through tab when i will reach on that image it should be highlight.

I have code like:

<td><a href="javascript:doSubmit();"><img src="../images/sign-in-btn.jpg" alt="" width="78" height="25" /></a></td>

it is a image which is solving the purpose of button. When use tab it is not highlighting this image. So i need help for this.

Waiting for early response.

Thanks in Advance: Tanu


You can achieve this with jQuery, put this line when you reach the img tab

jQuery("#imgId").animate( { backgroundColor: '#65A6D1' }, 500).animate( { backgroundColor: 'white' }, 1000);


If you just want your image to behave like a standard button when focused, showing the same dotted border, you just need to set the .tabIndex property on it:

<td>
<a href="javascript:doSubmit();">
<img src="../images/sign-in-btn.jpg" tabindex="0" alt="" width="78" height="25" />
</a></td> 


OK, I found another way. Instead of an img element, try using an input element which type is "image":

<td>
<a href="javascript:doSubmit();">
<input type="image" src="../images/sign-in-btn.jpg" alt="" width="78" height="25" />
</a></td>
These input elements normally behave like buttons when clicked or focused.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜