1.放哪一帧都行,你自己试试。
<script language=javascript>
ie4=(document.all)?true:false;
ns4=(document.layers)?true:false;
function toExit(){
var args=toExit.arguments;
var visible=args[0];
if(ns4){
theObj=eval("document.layers[\'"+args[1]+"\']");
if(theObj)theObj.visibility=visible;
}
else if(ie4){
if(visible=='show')visible='visible';
if(visible=='hide')visible='hidden';
theObj=eval("document.all[\'"+args[1]+"\']");
if(theObj)theObj.style.visibility=visible;
}}
</script>
<div id=div32
style="HEIGHT: 80px; LEFT: 309px; POSITION: absolute; TOP: 150px; VISIBILITY: hidden; WIDTH: 180px; Z-INDEX: 1">
<table bgcolor=#FF9900 border=1 cellpadding=0 cellspacing=0 height=80
width=180> <tbody>
<tr>
<td height=65 width="100%">
<table border=0 cellpadding=0 cellspacing=0 height=80 width="99%">
<tbody>
<tr>
<td height=57> <font
color=#ffffff>这是一个较简单的显示、隐藏层的例子,具体的应用范围还是比较大的。<b></b></font></td>
</tr>
<tr align="center">
<td height=23 width="100%"><a
href="javascript:toExit('hide','div32')"><font color=white>关闭此层</font></a></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
<a href="javascript:toExit('show','div32')"><font color="#FF9900">打开隐藏层</font></a>
2.用open方式打开网页.
有个参数:scrollbars=0就行了。
<script language=javascript>
ie4=(document.all)?true:false;
ns4=(document.layers)?true:false;
function toExit(){
var args=toExit.arguments;
var visible=args[0];
if(ns4){
theObj=eval("document.layers[\'"+args[1]+"\']");
if(theObj)theObj.visibility=visible;
}
else if(ie4){
if(visible=='show')visible='visible';
if(visible=='hide')visible='hidden';
theObj=eval("document.all[\'"+args[1]+"\']");
if(theObj)theObj.style.visibility=visible;
}}
</script>
<div id=div32
style="HEIGHT: 80px; LEFT: 309px; POSITION: absolute; TOP: 150px; VISIBILITY: hidden; WIDTH: 180px; Z-INDEX: 1">
<table bgcolor=#FF9900 border=1 cellpadding=0 cellspacing=0 height=80
width=180> <tbody>
<tr>
<td height=65 width="100%">
<table border=0 cellpadding=0 cellspacing=0 height=80 width="99%">
<tbody>
<tr>
<td height=57> <font
color=#ffffff>这是一个较简单的显示、隐藏层的例子,具体的应用范围还是比较大的。<b></b></font></td>
</tr>
<tr align="center">
<td height=23 width="100%"><a
href="javascript:toExit('hide','div32')"><font color=white>关闭此层</font></a></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
<a href="javascript:toExit('show','div32')"><font color="#FF9900">打开隐藏层</font></a>
2.用open方式打开网页.
有个参数:scrollbars=0就行了。
解决方案 »
- 如何实现用JavaScript方法按回车键?
- 跨页面增加复制出来的行
- 求一正则表达式,验证全零
- 怎样用javascript刷新modelDialog窗口,不用提交(在线等)
- jquery中的子集如何得到父级的label标签呢
- Ext JS问题
- 无分诚挚求教!有分后加倍奉还!!!
- <body onload="init()">
- 请问用什么函数判断从一个文本是不是数字
- 网页运行提示Uncaught ReferenceError: $ is not defined错误,页面脚本无法执行,在别人的电脑上可以执行怎么回事?
- 编写js文件用什么工具好?最好象VC一样,打点就可以列出属性,方法的。
- MS IE所支持的Javascript和NetScape所支持的JavaScript有什么不同?
<div id=img style="position: absolute; left: 0; top: 0;" >
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH=100 HEIGHT=80 >
<PARAM NAME=movie VALUE="cg.swf"> <PARAM NAME=wmode VALUE="Transparent">
</OBJECT>
</div>
<script src="flort.js"></script>
var xPos = 20;
var yPos = document.body.clientHeight;
var step = 1;
var delay = 30;
var height = 0;
var Hoffset = 0;
var Woffset = 0;
var yon = 0;
var xon = 0;
var pause = true;
var interval;
img.style.top = yPos;
function changePos() {
width = document.body.clientWidth;
height = document.body.clientHeight;
Hoffset = img.offsetHeight;
Woffset = img.offsetWidth;
img.style.left = xPos + document.body.scrollLeft;
img.style.top = yPos + document.body.scrollTop;
if (yon) {
yPos = yPos + step;
}
else {
yPos = yPos - step;
}
if (yPos < 0) {
yon = 1;
yPos = 0;
}
if (yPos >= (height - Hoffset)) {
yon = 0;
yPos = (height - Hoffset);
}
if (xon) {
xPos = xPos + step;
}
else {
xPos = xPos - step;
}
if (xPos < 0) {
xon = 1;
xPos = 0;
}
if (xPos >= (width - Woffset)) {
xon = 0;
xPos = (width - Woffset);
}
}
function start() {
img.visibility = "visible";
interval = setInterval('changePos()', delay);
}
start();
// End -->