先看看彈窗效果,如下::
//放大圖片$(page).on('click',','。popupImage img',function(){var that = $(this); that.popupimage({this:this:that,width:width:'200px'})}}); //相冊彈窗$ ..fn.popupimage = function(obj){var $ this = obj.this; var sj_w = $ this [0] .naturalHeight; var src = $ this.attr('src'); var h = $('身體')。高度(); var w = $('身體')。 width(); var填充= 10; var shadew = w -padding*2; var img ='',shade =''; img ='<div style =“位置:絕對; top:0;左:0; z index:999999; padding; padding:10px'+padding+'px; width; width:'+w+'px; height; height; height; height; heigh'+h+'px; line-height:'+h+h+'px; px; px; px; text-align; center; center;中心; >'+'<img src =“'+src+'“ style =” max-width:'+shadew+'px“/> </div>'; shade ='<div style =“位置:絕對; top:0; left:0; width:'+w+'px;高度:'+h+'px;背景:#000; z-index:999990; opcity; obacity:.8;'> </div>'> </div>'; $('身體')。附加(陰影); $('身體')。附加(IMG); $('。彈出圖像')。 on('click',function(){$('。popup-image')。刪除(); $('。shade')。刪除(); emove();})};以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持武林網。 ,也希望大家多多支持武林網。