Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting display: block !Important

Tags:

jquery

css

There is a problem with a rollover doesn't want to show its content and if I do

#callCenter {
    position: fixed;
    z-index: 2411 !important;
    display: block !important; /* please note here !important */
    right: 110px;
}

It's shown, but if I do: (so the div is hidden until another element is clicked)

#callCenter {
    position: fixed;
    z-index: 2411 !important;
    right: 110px;
}

And

$('#telefonosCabecera').click(function(){
    $("#callCenter").css('display','block!important'); // or 'block !important'
    alert('done')
});

I don't see #callCenter but I do see the alert.

What could be the reason for this?

like image 699
Toni Michel Caubet Avatar asked Sep 12 '11 14:09

Toni Michel Caubet


1 Answers

You need to do one of the following:

  1. Add a class with the !important rule (i.e.: .myClass{display:block !important;} ) and then add the class to the element
  2. Add the css attribute via $('#myElement').attr('style','display: block !important');
like image 121
Phoenix Avatar answered Oct 12 '22 12:10

Phoenix