jQuery set element style to the :hover css style

jQuery has .hover function which will freeze the hover effect.
It’d be better to just give that state another class itself in the CSS and then use your method to add that class.
You may keep the id of the div and control the css changes using class

	id2:hover {
		background-color: #23689D;
	}
	$('#id').attr('class', 'id2');

By Keenlio, June 3, 2014

What do you think?

Leave a Reply

Your email address will not be published. Required fields are marked *


8 − = five

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>