Using !important in jQuery's css() function

前端 未结 7 1866
长情又很酷
长情又很酷 2020-12-24 12:59

I have a dialog with an overlay declared like so:

     .ui-widget-overlay  {
         position: absolute;
         left: 8px;
         top: 9px;
         hei         


        
相关标签:
7条回答
  • 2020-12-24 13:31

    There is a trick to do this.

    $('.ui-widget-overlay').css('cssText', 'height:985px !important;');
    
    $('.ui-widget-overlay').css('cssText', 'height:1167px !important;');
    

    cssText is doing the trick here. It is appending css styles as string, not as variable.

    0 讨论(0)
提交回复
热议问题