javascript - Remove CSS properties that were set in a CSS file (not inline CSS) [jQuery] -
i have css property set in stylesheet file:
.main-outer-div-filter { max-height: 230px; }
i trying remove jquery so:
$('.main-outer-div-filter').css('max-height','');
for reason, way doesn't seem have affect, works if set style inline, not when in css file. there way use jquery reset/remove css properties, set in css file?
thank you
with ('max-height', '')
removing inline css. work if set inline before. reset it, use initial
value:
$(document).ready(function() { $('.special').css({ 'max-height': 'initial' }); });
li { height: 50px; border: 1px solid black; max-height: 20px; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <ul> <li>max-height: 20px;</li> <li class="special">max-height: initial;</li> </ul>
Comments
Post a Comment