I'm setting an inline box-shadow
style on a div.wrapper
when a user clicks a #menu-open
link. This overrides a default CSS style that is applied via the stylesheet. That is working.
However I also want to be able to remove that inline style when the user clicks the #menu-close
link so that we then default back to the style in the CSS file.
I currently have the following;
<p id="menu-open">...</p>
<p id="menu-close">...</p>
<div class="wrapper">...</div>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('#menu-open').click(function(){
jQuery('.wrapper').css('box-shadow', '0 0 3px rgba(0,0,0,0.75)');
});
jQuery('#menu-close').click(function(){
jQuery('.wrapper').css('box-shadow', '');
});
});
</script>
I've also tried removeAttr('style');
and attr('style', '');
with no success.