Skip to content

Instantly share code, notes, and snippets.

@sean9999
Created August 13, 2012 03:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sean9999/3336837 to your computer and use it in GitHub Desktop.
Save sean9999/3336837 to your computer and use it in GitHub Desktop.
adding important css
$("#pantry_boxes-products").on("mouseover",".box-product",function(event) {
$(this).children(".box-product-expanded").stop(true,false).animate({
opacity: 1,
"z-index": "50 !important"
},
{ "duration": 150 }
);
});
$("#pantry_boxes-products").on("mouseout",".box-product",function(event) {
$(this).children(".box-product-expanded").stop(true,false).animate({
opacity: 0,
"z-index": -10
},
{ "duration": 150 }
);
});
@sean9999
Copy link
Author

line 4 is the one to note. you simply set your z-index to a string rather than a number to include the "!important" qualifier. Note that these styles will be applied inline as part of the jquery animation, so they are all implicitly "!important".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment