如何在jQuery中包含!important [英] How to include !important in jquery

查看:57
本文介绍了如何在jQuery中包含!important的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用类似jQuery的css属性中添加!important

I am trying to add !important in the css attribute using jQuery like

$("tabs").css('height','650px;!important');

,但!important无效.如何在jquery中包含!important?

but !important has no effect. How to include !important in jquery?

推荐答案

显然,可以在jQuery中做到这一点:

Apparently it's possible to do this in jQuery:

$("#tabs").css("cssText", "height: 650px !important;");

Src: http://bugs.jquery.com/ticket/2066

这篇关于如何在jQuery中包含!important的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆