jquery - How to trigger mouse hover once page has been loaded? -


i want trigger mouse hover on hyperlink once page has been loaded completely.i don't want use active , visited this.(because of programming reasons).

i mean after page loading hyperlink should in having on hover color.

i trying code not getting success.

<html> <head>     <style type="text/css">     a:hover {     color: #00a000;     }     </style>     <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>          <script type="text/javascript">             jquery(document).ready(function(){                                           jquery("#mylink").trigger('mousehover');                         });         </script>    </head> <body> <a id="mylink" href="www.google.com">google</a> </body> </html> 

insetad of trying trigger mouseevent when there none, add class it. assume have css takes care of this. more cleaner imo , not abuse 'mousehover'.

jquery(document).ready(function(){                               jquery("#mylink").addclass('hover');             }); 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -