目前代码应该没什么bug了,兼容IE6.0&FF1.5,通过xHTML的Transitional验证和CSS验证。
为了能通过验证,只好再次改变使用的方式,改为用DIV实现,方法:
复制代码 代码如下:
<divclass="xWin">
<spanclass="xWinSetting">width="200"top="270"left="140"title="我就是传说中那个超长的窗口标题"</span>
content
</div>
xWin HTC Demo body { width:100%; height:100%; margin:0px; padding:0px; overflow:auto; } .xWin { position:absolute; cursor:default; border-width:2px; border-style:outset; padding:0px; font-size:12px; overflow:hidden; display:block; } .xWin .xWinSetting { display:none; } .xWin .xTitle { color:#FFFFFF; height:20px; display:block; } .xWin .xTitle input { background-color:transparent; color:#FFFFFF; border-width:0px; border-style:solid; height:20px; width:16px; line-height:20px; font-family:webdings; font-size:10px; margin:0px; padding:0px; text-align:center; float:right; display:block; } .xWin .xTitle .xWinTitleCloseButton { } .xWin .xTitle .xWinTitleMaxButton { } .xWin .xTitle .xWinTitleMinButton { } .xWin .xTitle .xWinTitleContent { color:#FFFFFF; font-size:12px; height:18px; line-height:20px; margin:0px; padding-left:3px; float:left; display:block; overflow:hidden; white-space:nowrap; text-align:left; cursor:default; } .xWin .xWinBody { margin:0px; background-color:#FFFFFF; color:#000000; padding:3px; font-size:12px; overflow:auto; position:relative; display:block; } .xShadow { position:absolute; display:block; background-Color:#000000; color:#FFFFFF; } //content 支持属性: int left, int top, int width, int height 支持方法: Close(), Destroy(), Max([bolean Variable]), Min([bolean Variable]), MoveTo(int x, int y), ResizeTo(int x, int y), SetContent(string Variable | htmlObject Variable) SetTitle(string Variable), ShowHide() */ //**载入CSS***** var xWinCssFilePath="sp/css/xwin.css"; //document.write("@import url("+xWinCssFilePath+");"); //**检测浏览器种类***** var BROWSERNAME=""; switch(navigator.appName.toLowerCase()){ case "netscape": BROWSERNAME="ns"; break; case "microsoft internet explorer": default: BROWSERNAME="ie"; break; } //**设置初始化变量****** switch(BROWSERNAME){ case "ns": window.addEventListener("load",_xWin_init,false); break; case "ie": default: window.attachEvent("onload",_xWin_init); } //**设置全局定时器****** if(typeof(__xSeriaTimer__)=="undefined"){ var __xSeriaTimer__={ events:new Array(), objs:new Array(), handle:null, exec:function(){ for(var i=0;i