// 通用的弹层插件
//power by 小新不坏
//qq:34542928
//blog:http://www.idboke.com
var popwin = {
scrolling: 'yes',
//是否显示滚动条 no,yes,auto
int: function() {
this.mouseclose();
this.closemask();
//this.mousedown();
},
showwin: function (width, height, title, src) {
var iframeheight = height - 52;
var marginleft = width / 2;
var margintop = height / 2;
var innthtml = '';
innthtml += '
'
innthtml += ''
innthtml += '
'
innthtml += '' + title + ''
innthtml += '
'
innthtml += '
'
innthtml += '
';
$("body").append(innthtml);
this.int();
},
mouseclose: function() {
$("#popwinclose").on('mouseenter',
function() {
//$(this).css("background-image", "url(../images/iconfont-close.png)");
});
$("#popwinclose").on('mouseleave',
function() {
//$(this).css("background-image", "url(../images/iconfont-close.png)");
});
},
closemask: function() {
$("#popwinclose").on('click',
function() {
$("#mask,#masktop").fadeout(function() {
$(this).remove();
});
});
}
/*mousedown : function(){
var dragging = false;
var ix, iy;
//var elmen = $("div#masktop");
$("#masktop").on('mousedown' , function(e){
dragging = true;
ix = e.clientx - this.offsetleft;
iy = e.clienty - this.offsettop;
this.setcapture && this.setcapture();
return false;
});
document.onmousemove = function(e) {
if (dragging) {
var e = e || window.event;
var ox = e.clientx - ix;
var oy = e.clienty - iy;
$("#masktop").css({"left":ox + "px", "top":oy + "px"});
return false;
}
};
$(document).mouseup(function(e) {
dragging = false;
$("#masktop")[0].releasecapture();
e.cancelbubble = true;
})
},*/
};