相关疑难解决方法(0)

更改bootstrap工具提示颜色

我要做的是将工具提示颜色更改为红色.但是,我也希望有多种其他颜色,所以我不想简单地替换原始工具提示的颜色.

我该怎么做呢?

html css twitter-bootstrap

116
推荐指数
11
解决办法
28万
查看次数

动态地向Bootstrap的'popover'容器添加一个类

我已经彻底搜索了StackOverflow和谷歌,但是空洞了.如果已经提出并已经解决了这个问题,请提前道歉.

NB:我是jQuery的新手,所以我不确定如何自己写这个.我确信这是一个简单的代码片段,但无法绕过它.

我要做的是使用一个data-元素(例如:data-class或类似的)将一个新类(或ID,我不再挑剔!)附加到顶级弹出窗口<div>.我目前的代码如下:

jQuery的:

$('a[rel=popover]')
    .popover({
        placement : 'bottom',
        trigger : 'hover'
    })
    .click(function(e) {
        e.preventDefault()
    });
Run Code Online (Sandbox Code Playgroud)

HTML:

<a href="" rel="popover" data-class="dynamic-class" title="Title goes here" data-content="Content goes here">
Run Code Online (Sandbox Code Playgroud)

理想情况下,我会吐出的HTML类型是这样的:

<div class="popover ... dynamic-class">
    <!-- remainder of the popover code as per usual -->
</div>
Run Code Online (Sandbox Code Playgroud)

这是我能做的吗?弹出窗口的bootstrap网站上的文档有点稀疏,所以我花了一段时间才到达这一点,不幸的是:(

在此先感谢任何和所有回复!

css jquery twitter-bootstrap

65
推荐指数
8
解决办法
7万
查看次数

将自定义类添加到工具提示

我想样式(css)一些bootstrap-tooltip.js工具提示,而不影响所有的工具提示.我尝试了很多不同的解决方案,但我总是最终在触发工具提示的元素中添加一个类.

这是我试过的:

$(function(){
  $("[id$=amount]").tooltip({
    trigger: 'manual',
    placement: 'right'
  }).addClass("test"); // <--- This does not help me. Class just ends up 
});                    //      in the trigger element. Se html output 
                       //      from firebug below...
Run Code Online (Sandbox Code Playgroud)

但是这个类只会在触发工具提示的元素中结束:

<input 
     id="list_wishes_attributes_0_amount" 
     class="test"  <!-- The class I tried to add to the tooltip ended up here. -->
     type="text" 
     tabindex="3" 
     size="30" 
     rel="tooltop" 
     name="list[wishes_attributes][0][amount]" 
     min="0" 
     data-original-title="Only numbers please"
/>
Run Code Online (Sandbox Code Playgroud)

如何为工具提示分配自定义类,而不是触发它的输入字段?

css jquery twitter-bootstrap

31
推荐指数
3
解决办法
4万
查看次数

标签 统计

css ×3

twitter-bootstrap ×3

jquery ×2

html ×1