【发布时间】:2012-09-13 17:44:51
【问题描述】:
我知道我可以转到 http://twitter.github.com/bootstrap/customize.html#components 并选择使弹出框工作所需的唯一组件。
我更新了js 和css 以链接到下载的文件。我没有收到任何错误,但我也没有收到弹出框。
原问题:
我想将弹出窗口添加到我的网站,但引导程序的标准 css 文件与我现有的样式冲突。来自http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css,有人能告诉我我需要哪些点点滴滴来制作popovers吗?我使用 Firebug 来查看调用了哪些类,但我显然遗漏了一些东西。我不必使用 Boostrap 的 Popover,如果它们易于使用,我对其他插件持开放态度。
CSS
/* CSS Document */
.popover {
position: absolute;
top: 0;
left: 0;
z-index: 1010;
display: none;
padding: 5px;
}
.popover.top {
margin-top: -5px;
}
.popover.right {
margin-left: 5px;
}
.popover.bottom {
margin-top: 5px;
}
.popover.left {
margin-left: -5px;
}
.popover.top .arrow {
bottom: 0;
left: 50%;
margin-left: -5px;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 5px solid #000000;
}
.popover.right .arrow {
top: 50%;
left: 0;
margin-top: -5px;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-right: 5px solid #000000;
}
.popover.bottom .arrow {
top: 0;
left: 50%;
margin-left: -5px;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-bottom: 5px solid #000000;
}
.popover.left .arrow {
top: 50%;
right: 0;
margin-top: -5px;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid #000000;
}
.popover .arrow {
position: absolute;
width: 0;
height: 0;
}
.popover-inner {
padding: 3px;
width: 280px;
overflow: hidden;
background: #000000;
background: rgba(0, 0, 0, 0.8);
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
-webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
}
.popover-title {
padding: 9px 15px;
line-height: 1;
background-color: #f5f5f5;
border-bottom: 1px solid #eee;
-webkit-border-radius: 3px 3px 0 0;
-moz-border-radius: 3px 3px 0 0;
border-radius: 3px 3px 0 0;
}
.popover-content {
padding: 14px;
background-color: #ffffff;
-webkit-border-radius: 0 0 3px 3px;
-moz-border-radius: 0 0 3px 3px;
border-radius: 0 0 3px 3px;
-webkit-background-clip: padding-box;
-moz-background-clip: padding-box;
background-clip: padding-box;
}
.popover-content p, .popover-content ul, .popover-content ol {
margin-bottom: 0;
}
.fade {
-webkit-transition: opacity 0.15s linear;
-moz-transition: opacity 0.15s linear;
-ms-transition: opacity 0.15s linear;
-o-transition: opacity 0.15s linear;
transition: opacity 0.15s linear;
opacity: 0;
}
.fade.in {
opacity: 1;
}
h3 {
/* line-height: 27px; */
font-size: 18px;
}
p {
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 13px;
line-height: 18px;
margin: 0 0 9px;
}
【问题讨论】:
-
如果不清楚,我确定需要上面的 CSS。
-
所以让你的风格更具体,无论如何这总是一个好主意,它们会覆盖。
-
看看source code。您必须编写自己的
.border-radius()函数并添加适当的变量。 -
该网站已有 8 年历史,我们被要求对其进行更新。该站点太大而无法仅为一个愚蠢的弹出窗口重做现有的 css,但客户真的想要它,所以谁知道呢。 :)
-
乔治编辑了我的问题,删除了我下载的组件,所以我在这里添加它们。我觉得很高兴知道我下载了什么,希望其他人可以告诉我我错过了什么或不需要什么:我下载了:1)选择组件 JS 组件工具提示弹出框 2)选择 jQuery 插件工具提示弹出框(需要工具提示) - 因为这就是为什么我还在上面第 1 节中选择了 toptips 的原因)。 3)自定义变量我保持原样
标签: jquery twitter-bootstrap popover