html
<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();
}
});
我希望这能在popover节目上执行,提前感谢任何可以找到问题的地方,
脚本:
$popover.on("show", function(e) {
$("#transbg").css("padding-bottom","2600px");
});
下面的参考代码在小提琴中工作正常但不能用我的代码
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");
});
答案 0 :(得分:1)
popover show
事件语法不正确,您可以尝试以下
HTML
<a class="poper btn" rel="popover" data-toggle="popover">
<h3 class="gv layout">
Layout Plan</h3>
</a>
<div class="popper-content hide">
html
</div>
JS
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");
});
请参阅this link关于bootstrap popover