"); var obj=$("body").find("#DivDialog"); obj.width("200px").height("200px"); obj.css({position:"absolute",top:"100px",left:"100px",background:"#FFCC66",zIndex:"10001"}).show("slow");
//JScript file $.fn.dialog=function(){ this.MaskDiv=function()//Customize a function { var wnd = $ (window), doc = $(document); if(wnd.height() > doc.height()){ //When the height is less than one screen wHeight = wnd.height(); }else{//When the height is greater than one screen wHeight = doc.height(); } //Create a mask background $("body").append("< ;div ID=MaskID>
"); $("body").find("#MaskID").width(wnd.width()).height(wHeight) .css ({position:"absolute",top:"0px",left:"0px",background:"#ccc",filter:"Alpha(opacity=90);",opacity:"0.3",zIndex:"10000" }); } this.sPosition=function(obj)//Customize a function with parameters { var MyDiv_w = parseInt(obj.width()); var MyDiv_h = parseInt(obj.height());
var width =parseInt($(document).width()); var height = parseInt($(window).height()); var left = parseInt($(document).scrollLeft()); var top = parseInt($(document).scrollTop());
var Div_topposition = top (height / 2 ) - (MyDiv_h / 2); //Calculate the top margin var Div_leftposition = left (width / 2) - (MyDiv_w / 2); //Calculate the left margin return Array(Div_topposition,Div_leftposition); } this.MaskDiv(); $("body").append("
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn