I have jquery like this:
$('.x').hover({
hover_width: 300,
hover_height: 400,
});
html code like this:
<div class='x' id='a'></div>
<div class='x'></div>
<div class='x'></div>
It is a very long code to actually put in, sorry to have made it shorter. I want to change the values for id ‘a’ & still hold the class because it uses some of the css. How to get the id inside the ‘hover’ in jquery & change the ‘hover_width = 200’ only for that id & not for the others.
I am looking for something like an if condition inside the ‘hover’ that gets the id name & gives value as ‘200’ else it just says ‘300’. Thank you.
Simply use the ID selector:
See http://api.jquery.com/category/selectors/ for a list of all selectors supported by jQuery. Since this is a superset of the CSS selectors reading about them would be a good idea, too.