有没有可能打开一个jQuery UI对话框没有标题栏?
当前回答
这对我隐藏对话框标题栏有用:
$(".ui-dialog-titlebar" ).css("display", "none" );
其他回答
这招对我很管用:
$("#dialog").dialog({
create: function (event, ui) {
$(".ui-widget-header").hide();
},
下一种形式解决了我的问题。
$('#btnShow').click(function() { $("#basicModal").dialog({ modal: true, height: 300, width: 400, create: function() { $(".ui-dialog").find(".ui-dialog-titlebar").css({ 'background-image': 'none', 'background-color': 'white', 'border': 'none' }); } }); }); #basicModal { display: none; } <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script> <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/smoothness/jquery-ui.css" /> <div id="basicModal"> Here your HTML content </div> <button id="btnShow">Show me!</button>
对我来说,我仍然想使用重新调整大小的角,只是不想看到对角线。我使用
$(".ui-resizable-handle").css("opacity","0");
我刚意识到我回答错问题了。不辜负我的名字:(
如果你有多个对话框,你可以使用这个:
$("#the_dialog").dialog({
open: function(event, ui) {
//hide titlebar.
$(this).parent().children('.ui-dialog-titlebar').hide();
}
});
我相信你可以用CSS隐藏它:
.ui-dialog-titlebar {
display: none;
}
或者,你可以使用dialogClass选项将其应用于特定的对话框:
$( "#createUserDialog" ).dialog({
dialogClass: "no-titlebar"
});
.no-titlebar .ui-dialog-titlebar {
display: none;
}
看看“主题化”对话。上面的建议使用了dialogClass选项,该选项似乎正在被一种新的方法取代。
推荐文章
- src和dist文件夹的作用是什么?
- jQuery UI对话框-缺少关闭图标
- jQuery。由于转义了JSON中的单引号,parseJSON抛出“无效JSON”错误
- 如何使用jQuery检测页面的滚动位置
- 如何在JSON中使用杰克逊更改字段名
- 在JavaScript中根据键值查找和删除数组中的对象
- 防止在ASP中缓存。NET MVC中使用属性的特定操作
- jQuery: keyPress退格键不火?
- XMLHttpRequest Origin null不允许Access-Control-Allow-Origin for file:/// to file:///(无服务器)
- 重置setTimeout
- jQuery有不聚焦的方法吗?
- jQuery -替换字符串中某个字符的所有实例
- Ng-repeat结束事件
- 模糊vs聚焦-有什么真正的区别吗?
- 如何用jQuery / JavaScript解析JSON数据?