3

I have a question regarding to Bootstrap 3. I want to show popover, when the page is loaded -> when client opens certain html page, popover shows up and then after some time that popover fades out. What is the best way to do this? I am trying this where .poper is just a div's class around image

$(window).load(function(){
 $(".poper").popover('show');
    $(".poper").hide(600);
});

Thank You for Your replies.

4

1 回答 1

7

如果我猜对了,如果页面已完全加载,您希望显示弹出框,因此页面已准备就绪。

如果是这样,一个可能的解决方案可能是在脚本中设置超时,这会调用弹出窗口来关闭。这可能看起来像这样:

$().ready(function(){
    $('.poper').popover('show');
    window.setTimeout(function(){
        $('.poper').popover('hide');
    }, 600); //600 are the ms until the timeout is called
});

说明:脚本显示直到页面完全加载弹出框.poper并开始超时,它将在 600 毫秒后关闭它。

于 2013-09-21T14:05:18.607 回答