//------------------------------------------------------------------------ //simpleWindown("sample","text:text1","500","400","true","3000","0","exa") //------------------------------------------------------------------------ var showWindown = true; var templateSrc = ""; //set loading.gif path function tipsWindown(title,content,width,height,drag,time,showbg,cssName) { jQuery("#windown-box").remove(); //clear content var width = width>= 950?this.width=950:this.width=width; //set max window width var height = height>= 527?this.height=527:this.height=height; //set max window height if(showWindown == true) { var simpleWindown_html = new String; simpleWindown_html = "
"; simpleWindown_html += "
");
});
jQuery.ajax({
error:function(){
jQuery("#windown-content").html("load error...
"); }, success:function(html){ jQuery("#windown-content").html("
");
});
jQuery.ajax({
type:content_array[0],
url:content_array[1],
data:content_array[2],
error:function(){
jQuery("#windown-content").html("load error...
"); }, success:function(html){ jQuery("#windown-content").html(html); } }); break; case "iframe": jQuery("#windown-content").ajaxStart(function(){ jQuery(this).html("
");
});
jQuery.ajax({
error:function(){
jQuery("#windown-content").html("load error...
"); }, success:function(html){ jQuery("#windown-content").html(""); } }); } jQuery("#windown-title h2").html(title); if(showbg == "true") {jQuery("#windownbg").show();}else {jQuery("#windownbg").remove();}; jQuery("#windownbg").animate({opacity:"0.5"},"normal");//set opacity jQuery("#windown-box").show(); if( height >= 527 ) { jQuery("#windown-title").css({width:(parseInt(width)+22)+"px"}); jQuery("#windown-content").css({width:(parseInt(width)+17)+"px",height:height+"px"}); }else { jQuery("#windown-title").css({width:(parseInt(width)+10)+"px"}); jQuery("#windown-content").css({width:width+"px",height:height+"px"}); } var cw = document.documentElement.clientWidth,ch = document.documentElement.clientHeight,est = document.documentElement.scrollTop; var _version = jQuery.browser.version; if ( _version == 6.0 ) { jQuery("#windown-box").css({left:"50%",top:(parseInt((ch)/2)+est)+"px",marginTop: -((parseInt(height)+53)/2)+"px",marginLeft:-((parseInt(width)+32)/2)+"px",zIndex: "999999"}); }else { jQuery("#windown-box").css({left:"50%",top:"50%",marginTop:-((parseInt(height)+53)/2)+"px",marginLeft:-((parseInt(width)+32)/2)+"px",zIndex: "999999"}); }; var Drag_ID = document.getElementById("windown-box"),DragHead = document.getElementById("windown-title"); var moveX = 0,moveY = 0,moveTop,moveLeft = 0,moveable = false; if ( _version == 6.0 ) { moveTop = est; }else { moveTop = 0; } var sw = Drag_ID.scrollWidth,sh = Drag_ID.scrollHeight; DragHead.onmouseover = function(e) { if(drag == "true"){DragHead.style.cursor = "move";}else{DragHead.style.cursor = "default";} }; DragHead.onmousedown = function(e) { if(drag == "true"){moveable = true;}else{moveable = false;} e = window.event?window.event:e; var ol = Drag_ID.offsetLeft, ot = Drag_ID.offsetTop-moveTop; moveX = e.clientX-ol; moveY = e.clientY-ot; document.onmousemove = function(e) { if (moveable) { e = window.event?window.event:e; var x = e.clientX - moveX; var y = e.clientY - moveY; if ( x > 0 &&( x + sw < cw) && y > 0 && (y + sh < ch) ) { Drag_ID.style.left = x + "px"; Drag_ID.style.top = parseInt(y+moveTop) + "px"; Drag_ID.style.margin = "auto"; } } } document.onmouseup = function () {moveable = false;}; Drag_ID.onselectstart = function(e){return false;} } jQuery("#windown-content").attr("class","windown-"+cssName); var closeWindown = function() { jQuery("#windownbg").remove(); jQuery("#windown-box").fadeOut("slow",function(){jQuery(this).remove();}); } if( time == "" || typeof(time) == "undefined") { jQuery("#windown-close").click(function() { jQuery("#windownbg").remove(); jQuery("#windown-box").fadeOut("slow",function(){jQuery(this).remove();}); }); }else { setTimeout(closeWindown,time); } }
");
});
jQuery.ajax({
error:function(){
jQuery("#windown-content").html("
");
});
jQuery.ajax({
type:content_array[0],
url:content_array[1],
data:content_array[2],
error:function(){
jQuery("#windown-content").html("
");
});
jQuery.ajax({
error:function(){
jQuery("#windown-content").html("