我使用jQuery插件创建了一个加载.php站点的弹出窗口:bpopup.
问题是插件不会加载在php编码的网站。谁能告诉我哪里出了问题?
这是我正在使用的代码:
JavaScript:$('#leader').bind('click', function (e) {
// Prevents the default action to be triggered.
e.preventDefault();
// Triggering bPopup when click event is fired
$('#leaderboard').bPopup({
modalClose: false,
opacity: '0',
positionStyle: 'fixed', //'fixed' or 'absolute'
content: 'iframe', //'ajax', 'iframe' or 'image'
contentContainer: '.content',
loadUrl: 'http://remake.hr/memtest/leaderboard.php' //Uses jQuery.load()
});
});
HTML: <div id="leaderboard" class="info"></div>
<div class="button" id="leader"></div>
CSS: .info {
display:none;
width:700px;
background: rgb(38, 170, 225);
/* Fall-back for browsers that don't support rgba */
background: rgba(38, 170, 225, .9);
color:white;
line-height: 35px;
padding: 25px 50px 50px 25px;
}
使用class="content"
为HTML添加内部div标签
对于contentContainer: '.content'
,您指定该容器。
生成的HTML:
<div id="leaderboard" class="info"><div class="content"></div></div>
<div class="button" id="leader"></div>