bpopup使用示例:http://dinbror.dk/bpopup/
简单用法如下:
$(function(){
var o=$('.question-name').next('img');
if(o.length>0){
o.bind('click', function(e) {
// Prevents the default action to be triggered.
e.preventDefault();
// Triggering bPopup when click event is fired
$('#element_to_pop_up').bPopup();
});
}
})
html代码:
<p class="question-name">
bpopup使用
</p>
<img src="http://missever.com/wp-content/uploads/missimg/2013/04/111914ijU.jpg" style="max-width:180px; max-height:150px;cursor: pointer" alt=""/>
<div id="element_to_pop_up" style="display: none">
<img src="http://missever.com/wp-content/uploads/missimg/2013/04/111914ijU.jpg>" alt=""/>
</div>