What's wrong? I want to change the opacity if #nav .drop is display:block;
jQuery(document).ready(function(){
if (jQuery('#nav .drop').css('display') === 'block') {
jQuery('#main').css('opacity') = '0.6';
}
});
jQuery('#main').css('opacity') = '0.6';
should be
jQuery('#main').css('opacity', '0.6');
Update:
http://jsfiddle.net/GegMk/ if you type in the text box. Click away, the opacity changes.
display: blockit is hidden, so why not just set it permanently to 60% opacity? Or am I missing something? It would be nice to see a working example of this.