Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 对popover show和hide的样式有问题_Javascript_Jquery_Twitter Bootstrap_Styling_Bootstrap Popover - Fatal编程技术网

Javascript 对popover show和hide的样式有问题

Javascript 对popover show和hide的样式有问题,javascript,jquery,twitter-bootstrap,styling,bootstrap-popover,Javascript,Jquery,Twitter Bootstrap,Styling,Bootstrap Popover,html 我想在popover show上执行此操作,提前感谢您能找到这里的问题所在 脚本: <a class="popper btn" rel="popover" data-toggle="popover"><h3 class="gv layout">Layout Plan</h3> </a> <div class="popper-content hide"> <a href="pdf/layout1.pdf" targe

html

我想在popover show上执行此操作,提前感谢您能找到这里的问题所在

脚本:

<a class="popper btn" rel="popover" data-toggle="popover"><h3 class="gv layout">Layout Plan</h3> </a>
<div class="popper-content hide"> 
  <a href="pdf/layout1.pdf" target="_blank"><img src="images/layout1.jpg" class="btn"/></a> 
  <a href="pdf/layout2.pdf" target="_blank"><img src="images/layout2.jpg" class="btn"/></a> 
  <a href="pdf/layout3.pdf" target="_blank"><img src="images/layout3.jpg" class="btn"/></a> 
</div>
$('.popper').popover({
placement: 'bottom',
container: 'body',
html: true,
content: function () {
    return $(this).next('.popper-content').html();
}
});
下面的ref代码在fiddle中运行良好,但与我的代码不兼容

$popover.on("show", function(e) {
    $("#transbg").css("padding-bottom","2600px");
});

popover
show
事件语法不正确,您可以尝试以下方法吗

HTML


请参考有关引导popover的信息

您的transbg id似乎是missing@ChristianEsperar我在我的html代码中使用它来标记一个div。你能创建JSFIDLE吗?它包含所有不适合你的相关代码,hi@shu我试过上面的代码它不会触发popoverhi使用了来自fiddle的ref代码它在fiddle中运行良好,但在我的code@sasijj你能检查一下类名吗?它是
popper
还是
popper
,我也更新了答案check@sasijj您使用的是哪个版本的引导程序bootstrap v 3.3.1其权限我确信它工作正常,但问题是我无法调用popover上的函数显示和隐藏,即使我尝试了bootstrap事件侦听器样式show.bs.popover
   var $popover = $(".poper").popover({
    trigger: "click"
}).click(function(e) {
    e.$("#transbg").css("padding-bottom","260px"); 
});

$popover.on("hide", function(e) {
    $("#transbg").css("padding-bottom","50px");
});
<a class="poper btn" rel="popover" data-toggle="popover">
    <h3 class="gv layout">
        Layout Plan</h3>
</a>
<div class="popper-content hide">
    html
</div>
var abc = $('.poper').popover({
    placement: 'bottom',
    container: 'body',
    trigger: 'hover',
    html: true,
    content: function () {
       return $(this).next('.popper-content').html();
    }
});

abc.on("shown.bs.popover", function (e) {
  console.log("popover shown");
});

abc.on("hidden.bs.popover", function (e) {
  console.log("popover hidden");
});