小编sri*_*lla的帖子

Bootstrap警报自动关闭

我需要在单击Add to Wishlist按钮时调用警报,并在2秒内消失警报.这就是我尝试的方式,但警报一出现就立即消失.不确定,错误在哪里..任何人都可以帮助我吗?

JS脚本

  $(document).ready (function(){
            $("#success-alert").hide();
            $("#myWish").click(function showAlert() {
                $("#success-alert").alert();
                window.setTimeout(function () { 
                            $("#success-alert").alert('close'); }, 2000);               
                  });       
                    });
Run Code Online (Sandbox Code Playgroud)

HTML代码:

<div class="product-options">
    <a  id="myWish" href=""  class="btn btn-mini" >Add to Wishlist </a>
    <a  href="#" class="btn btn-mini"> Purchase </a>
</div>
Run Code Online (Sandbox Code Playgroud)

警报框:

<div class="alert alert-success" id="success-alert">
    <button type="button" class="close" data-dismiss="alert">x</button>
    <strong>Success! </strong>
    Product have added to your wishlist.
</div>
Run Code Online (Sandbox Code Playgroud)

html javascript alert twitter-bootstrap

140
推荐指数
6
解决办法
29万
查看次数

Bootstrap Popover内容中的外部HTML文件

当我使用iframe在popover内容中加载外部html文件时,它限制为弹出窗口高度.但我希望弹出窗口的高度是自动的.有人帮助我.

$(document).ready(function(){
  $('.pop-right').popover({ 
title : 'Loading External File',
html : true,
placement : "right",
content: function () {
      return '<iframe src="popover-content.html" style="border:none"></iframe>';    
        });
    }
  });
});
Run Code Online (Sandbox Code Playgroud)

jquery popover twitter-bootstrap

5
推荐指数
1
解决办法
3547
查看次数

如何将文本放在对角线上?

对角线上的文字

嘿家伙,我想你看了上面的图片就明白了我的想法。我无法在文本后面放置对角线,它应该被放置在其上的内容所掩盖。我想要它是纯CSS的。背景应该通过文本可见。

html css css-transforms css-shapes

5
推荐指数
1
解决办法
1484
查看次数