PDA

View Full Version : Javascript Help



Jis Anup
01-27-2011, 07:09 AM
I have added

<a href='javascript: submit_form();' class='ask_qns' ></a>Instead of form submit button. And I have add hover effect through css.
That code is like

.ask_qns
{
float:left;
width:366px;
height:34px;
background-image:url(images/home_askqn.jpg);
background-repeat:no-repeat;

}

.ask_qns:hover
{
float:left;
width:366px;
height:34px;
background-image:url(images/home_askqn_h.jpg);
background-repeat:no-repeat;
}
The problem is like for first time after loading the page mouseover effect is not coming. Button is disappearing for the first time of execution. After that its coming fine...
Please help me to solve this problem.

coothead
01-27-2011, 09:00 AM
Hi there Jis Anup,

your problem can be resolved by the use of the single image rollover method. ;)

Further reading:-

single image rollover method (http://www.google.co.uk/search?q=single+image+rollover+method)
content unusable if images are turned off in a graphical browser (http://levinalex.net/files/20030809/alternatefir.html)

To get you started check out the attachment for an example that is similar to your original code.
&#160;
&#160;
coothead

Jis Anup
01-28-2011, 05:35 AM
Thank You so much

coothead
01-28-2011, 08:23 AM
No problem, you're very welcome. ;)