13、全屏显示
说明:真正的全屏显示,只能用ALT+F4关闭
代码:
<input type="BUTTON" name="FullScreen" value="全屏显示" onClick="window.open(document.location, 'www_ycrc_com_cn',
'fullscreen')">
14、打开一个全屏窗口
说明:用按钮打开一个全屏窗口
代码:
<input type="button" onClick="www_ycrc_com_cn()" value="试试看" name="button">
<script>
<!--
function www_ycrc_com_cn(){
var targeturl="http://www.ycrc.com.cn"
newwin=window.open("","","scrollbars")
if (document.all){
newwin.moveTo(0,0)
newwin.resizeTo(screen.width,screen.height)
}
newwin.location=targeturl
}
//-->
</script>
15、各种用途的按钮大集合
说明:各种用途的按钮大集合
代码:
<input TYPE="button" NAME="view" VALUE="查看源代码" OnClick="window.location='view-source:' +window.location.href" >
<input TYPE="button" VALUE="返回上一步" ONCLICK="history.back(-1)">
<input TYPE="button" VALUE="刷新按钮一" ONCLICK="ReloadButton()">
<script language="JavaScript">
<!--
function ReloadButton(){location.href="3.html";}
// -->
</script>
<p>
<input TYPE="button" VALUE="刷新按钮二" onClick="history.go(0)">
<input TYPE="button" VALUE="回首页按钮" ONCLICK="HomeButton()">
<script language="JavaScript">
<!--
function HomeButton(){location.href="http://www.ycrc.com.cn";}
// -->
</script>
<input TYPE="button" VALUE="弹出警告框" ONCLICK="AlertButton()">
<script language="JavaScript">
<!--
function AlertButton(){window.alert("今天你喝了没有?:)");}
// -->
</script>
<p>
<input TYPE="button" VALUE="状态栏信息" ONCLICK="StatusButton()">
<script language="JavaScript">
<!--
function StatusButton(){window.status="你好吗?:)";}
// -->
</script>
<input TYPE="button" VALUE="背景色变换" onClick="BgButton()">
<script language="JavaScript">
<!--
function BgButton(){
if (document.bgColor=='#3399ff')
{document.bgColor='#00ccff';}
else{document.bgColor='#3399ff';}
}
// -->
</script>
<input TYPE="button" VALUE="打开新窗口" ONCLICK="NewWindow()">
<script language="JavaScript">
<!--
function
NewWindow(){window.open("http://www.ycrc.com.cn","","height=600,width=800,left=10,top=10,status=no,location=no,toolbar=no,
directories=no,menubar=no");}
// -->
</script>
16、特殊效果的按钮
说明:特殊效果的按钮
代码:
<style type="text/css">
<!--
.over {color:yellow; background: navy}
.down {color:yellow; background: navy; font-style: italic}
-->
</style>
<input
type="Button" value="按钮也疯狂" name="Button"
onMouseOver="this.className='over';"
onMouseOut="this.className='';this.value='按钮也疯狂'"
onMouseDown="this.className='down';"
onMouseUp="this.className='over';"
onClick="this.value='我真的好喜欢你!'">
17、让屏幕抖动一阵
说明:让屏幕抖动一阵
代码:
<input onclick="www_ycrc_com_cn(2)" type="button" value="地震啦!!!">
<script language="JavaScript">
<!--
function surfto(form) {
var myindex=form.select1.selectedIndex
if (form.select1.options[myindex].value != null) {
parent.main.location.href=form.select1.options[myindex].value;
}
}
// -->
</script>
<script language="JavaScript1.2">
<!--
function www_ycrc_com_cn(n) {
if (window.top.moveBy) {
for (i = 10; i > 0; i--) {
for (j = n; j > 0; j--) {
window.top.moveBy(0,i);
window.top.moveBy(i,0);
window.top.moveBy(0,-i);
window.top.moveBy(-i,0);
}
}
}
alert(" 没吓坏吧!!! ");
}
// -->
</script>