function showDialog(){ var $by = $(window), obj = $('.dialog'), brsW = $by.width(), brsH = $by.height(), sclL = $by.scrollLeft(), sclT = $by.scrollTop(), curW = obj.width(), curH = obj.height(); //计算对话框居中时的左.上边距 var left = sclL + (brsW - curW)/2; var…