function TB_show(content,w,h) { try { //隐藏所有的select var obj; obj=document.getElementsByTagName("SELECT"); var i; for(i=0;i
"); $("#TB_overlay").click(TB_remove); } $(window).scroll(TB_position); TB_overlaySize(); $("body").append("
Loading....
"); TB_load_position(); TB_WIDTH = (w*1) + 30; TB_HEIGHT = (h*1) + 40; ajaxContentW = TB_WIDTH - 30; ajaxContentH = TB_HEIGHT - 45; $("#TB_window").append("
"); $("#TB_closeWindowButton").click(TB_remove); $("#TB_ajaxContent").html(content); TB_position(); $("#TB_load").remove(); $("#TB_window").css({display:"block"}); $(window).resize(TB_position); } catch(e) { alert( e ); } } //helper functions below function TB_remove() { $("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay').remove();}); $("#TB_load").remove(); //$(document).unkeyup(); // 显示所有的select var obj; obj=document.getElementsByTagName("SELECT"); var i; for(i=0;i document.body.offsetHeight){ // all but Explorer Mac yScroll = document.body.scrollHeight; } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari yScroll = document.body.offsetHeight; } $("#TB_overlay").css("height",yScroll +"px"); } function TB_load_position() { var pagesize = TB_getPageSize(); var arrayPageScroll = TB_getPageScrollTop(); $("#TB_load") .css({left: ((pagesize[0] - 100)/2)+"px", top: (arrayPageScroll[1] + ((pagesize[1]-100)/2))+"px" }) .css({display:"block"}); } function TB_getPageScrollTop(){ var yScrolltop; if (self.pageYOffset) { yScrolltop = self.pageYOffset; } else if (document.documentElement && document.documentElement.scrollTop){ // Explorer 6 Strict yScrolltop = document.documentElement.scrollTop; } else if (document.body) {// all other Explorers yScrolltop = document.body.scrollTop; } arrayPageScroll = new Array('',yScrolltop) return arrayPageScroll; } function TB_getPageSize(){ var de = document.documentElement; var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth; var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight; arrayPageSize = new Array(w,h) return arrayPageSize; } function befaint(obj,n) { if(n==0) { $(obj).fadeOut(2000,function(){$(this).remove();}); } else if(n==1) { $(obj).parent().fadeOut(2000,function(){$(this).remove();}); } else if(n==2) { $(obj).parent().parent().fadeOut(2000,function(){$(this).remove();}); } else if(n==3) { $(obj).parent().parent().parent().fadeOut(2000,function(){$(this).remove();}); } else if(n==4) { $(obj).parent().parent().parent().parent().fadeOut(2000,function(){$(this).remove();}); } }