jQuery 如何删除css溢出:隐藏的jquery对话框

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14612460/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 13:45:52  来源:igfitidea点击:

how to remove the css overflow:hidden of jquery dialog

jqueryhtmlcss

提问by scireon

I want to add a search input and overlap it on title bar of a jQuery dialog but my problems are:

我想添加一个搜索输入并将其重叠在 jQuery 对话框的标题栏上,但我的问题是:

  • I can't remove the css overflow property of this specific jQuery dialog
  • The Title bar is always at the top of my input search box.
  • 我无法删除此特定 jQuery 对话框的 css 溢出属性
  • 标题栏始终位于我的输入搜索框的顶部。

I've also tried this:

我也试过这个:

 $('div#viewVoters').attr('style','overflow:visible');
 $('#viewVoters').css('overflow','');
 $('#viewVoters').remove('style');

Any idea how to remove the css property or any idea how to add a search input to it?

知道如何删除 css 属性或知道如何向其添加搜索输入吗?

<div id="viewVoters" style="width: auto; min-height: 95px; height: auto; overflow: hidden;" class="ui-dialog-content ui-widget-content" scrolltop="0" scrollleft="0">  
</div>

回答by Turnip

Just override it in your CSS:

只需在您的 CSS 中覆盖它:

#viewVoters {
    overflow: auto !important;  /* or 'visible' whatever */
}

回答by Taymoor Q.

$('#viewVoters').css('overflow','visible');

this will work for sure instead of

这肯定会起作用,而不是

$('#viewVoters').css('overflow','');

回答by kelly johnson

yeah, better to get the specificity right than use !important in a production site.

是的,比在生产站点中使用 !important 更好地获得特异性。

Remember that one ID is higher than 4 classes and an element... '#MyID' is stronger than '.class1 .class2 .class3 .class4 p', so you probably need to look a parents to see where else there are ID's.

请记住,一个 ID 高于 4 个类和一个元素...“#MyID”比“.class1 .class2 .class3 .class4 p”强,因此您可能需要查看父级以查看其他位置还有 ID。