×

浅析JQuery UI Dialog的样式设置问题

作者:Terry2017.02.15来源:Web前端之家浏览:10579评论:0
关键词:JQueryJS

最近在用一个JQUERY UI Dialog的插件,感觉特别强大,但样式设置比较麻烦,研究了俩天终于搞定了。

运行插件,需要的环境如下

<script src="../../JS/jquery-1.4.2.js" type="text/javascript"></script>

<script src="../JS/jquery.ui.js" type="text/javascript"></script>

<link href="CSS/themes/redmond/jquery.ui.all.css" rel="stylesheet" type="text/css" />


jquery.ui.all.css 为启动样式的CSS ,用firefox打开查看 ,浮层的title 如下,

<span id="ui-dialog-title-divShow" class="ui-dialog-title" unselectable="on" style="-moz-user-select: none;">百姓一站通提示</span>

其实就是一个span,那么 根据这个class ui-dialog-title  我们去 官网的CSS目录里 找到jquery.ui.dialog.css 文件 查找classui-dialog-title  这个CSS样式。

.ui-dialog .ui-dialog-title { font: 62.5% "Trebuchet MS" , sans-serif;font-weight:bold;float: left; margin: .1em 16px .1em 0; height:15px }

对这个css进行修改即可达到我们想要的浮层的头样式了。

header的背景设置:

.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }

可以去掉背景图片 设置为背景颜色

.ui-widget-header { border: 1px solid #aaaaaa; background-color:red; color: #222222; font-weight: bold; }

关于x与右下角的图标设置:

图标.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }

您的支持是我们创作的动力!
温馨提示:本文作者系Terry ,经Web前端之家编辑修改或补充,转载请注明出处和本文链接:
https://www.jiangweishan.com/article/svg1487088000647.html

网友评论文明上网理性发言已有0人参与

发表评论: