熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> JSP教程 >> 正文

頁面自動最大化特效JS代碼

2022-06-13   來源: JSP教程 

  代碼最常用的代碼比較簡單
代碼如下:
<script language="javascript">
selfmoveto()
selfresizeto(screenavailwidthscreenavailheight)
</script>

  代碼
以下代碼放在<head></head>之間:
代碼如下:
<script language=″javascript″>
<!--function winfix() {
if (document.layers) {
width=screenavailWidth-;
height=screenavailHeight-;
} else {
var width=screenavailWidth-;
var height=screenavailHeight;
}
selfresizeTo(width height);
selfmoveTo( );
}
//-->
</script>

  以下代碼放在<body>Tag裡
代碼如下:
<body onload=″winfix()″>

  代碼
代碼如下:
<script language="javascript">
selfmoveTo()
selfresizeTo(screenavailWidthscreenavailHeight)
</script>
<OBJECT id="max" type="application/xoleobject" classid="clsid:adbadffcf
aaba">
<PARAM name="Command" value="Maximize"></OBJECT>
<BODY onload="if(documentbodyoffsetWidth<screenwidth)maxClick()">>

  代碼
代碼如下:
<SCRIPT>
var mywidth
if (navigatorappNameindexOf(Netscape) != ) {
mywidth=parseInt(windowouterWidth);
//alert("ns")
}
else{
if (navigatorappNameindexOf(Microsoft) != ) {
mywidth=documentbodyclientWidth;
//alert("ie")
}
}
var ScreenOffset;
if (mywidth <= ) {
//alert("")
}else{
ScreenOffset = parseInt((mywidth )/);
ScreenOffset = ;
// alert("")
}
fwLoadMenus();
windowonresize = function (){
if (navigatorappNameindexOf(Netscape) != ) {
mywidth=parseInt(windowouterWidth);
if(selfscreenLeft>){
maximizeClick();
}
}
else{
if (navigatorappNameindexOf(Microsoft) != ) {
mywidth=documentbodyclientWidth;
if(selfscreenLeft>){
maximizeClick();
}
}
}
}
function ChangeLocation(){
var size = screenwidth;
if(size!=""){
documentlocation="index__aspx";
}
}
</SCRIPT>


From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20556.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.