• WAP手机版 RSS订阅 加入收藏  设为首页
站长杂谈

网页代码--隐藏层的打开和关闭 层隐藏,层点开

时间:2013/9/15 22:45:00   作者:小利子   来源:正势利   阅读:637   评论:4
内容摘要:嗨你好:你看到的这个效果怎么样 喜欢么 嘻嘻 Q:49922779第一种文字形式代码如下:















第一种文字形式代码如下:
<input name="" type="button" value="点击显示效果" id="btn" onclick="btn()" style="position:absolute; left:320px; top:230px;">
<div id="box" style="border: 1px solid rgb(0, 0, 0); height: 300px; width: 300px; display: none; ">嗨你好:你看到的这个效果怎么样 喜欢么 嘻嘻 Q:49922779</div>
</body>
<script type="text/javascript">
var btn1=document.getElementById('btn');
var box1=document.getElementById('box');
function btn(){ if(btn1.value=="点击隐藏效果"){box1.style.display='none';btn1.value="点击显示效果";
 }else{box1.style.display='';btn1.value="点击隐藏效果";
}
}
</script>

第二种SWF形式代码如下:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>代码-特效-点击显隐的网页内容Http://www.zhengshili.com</title>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
<body bgcolor="#F5F2E5">
<!--把下面代码加到<head>与</head>之间-->
<script type="text/javascript">
function UBBShowObj(strType,strID,strURL,intWidth,intHeight)
{
 var varHeader="V";
 var tmpstr="";
 var bSwitch = false;
 bSwitch = document.getElementById(varHeader+strID).value;
 bSwitch =~bSwitch;
 document.getElementById(varHeader+strID).value = bSwitch;
 if(bSwitch){
  document.getElementById(strID).innerHTML = "<a href='"+strURL+"' target='_blank'>Url...</a>";
 }else{
  switch(strType.toUpperCase()){
   case "SWF":
    tmpstr="<object codeBase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='"+intWidth+"' height='"+intHeight+"'><param name='movie' value='"+strURL+"'><param name='quality' value='high'><param name='AllowScriptAccess' value='never'><embed src='"+strURL+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+intWidth+"' height='"+intHeight+"'>'"+strURL+"'</embed></object>";
    break;
   case "MP3":
    tmpstr="<object classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95'  id='MediaPlayer' width='"+intWidth+"' height='"+intHeight+"'><param name='ShowStatusBar' value='-1'><param name='AutoStart' value='True'><param name='Filename' value='"+strURL+"'></object>";
    break;
   case "WMA":
    tmpstr="<object classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95'  id='MediaPlayer' width='"+intWidth+"' height='"+intHeight+"'><param name='ShowStatusBar' value='-1'><param name='AutoStart' value='True'><param name='Filename' value='"+strURL+"'></object>";
    break;
   case "WMV":
    tmpstr="<object classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' width='"+intWidth+"' height='"+intHeight+"'><param name='ShowStatusBar' value='-1'><param name='AutoStart' value='Ture'><param name='Filename' value='"+strURL+"'></object>";
    break;
   case "RM":
    tmpstr="<object classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' height='"+intHeight+"' id='Player' width='"+intWidth+"' viewastext><param name='_ExtentX' value='12726'><param name='_ExtentY' value='8520'><param name='AUTOSTART' value='0'><param name='SHUFFLE' value='0'><param name='PREFETCH' value='0'><param name='NOLABELS' value='0'><param name='CONTROLS' value='ImageWindow'><param name='CONSOLE' value='_master'><param name='LOOP' value='0'><param name='NUMLOOP' value='0'><param name='CENTER' value='0'><param name='MAINTAINASPECT' value='"+strURL+"'><param name='BACKGROUNDCOLOR' value='#000000'></object><br><object classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' height='32' id='Player' width='"+intWidth+"' VIEWASTEXT><param name='_ExtentX' value='18256'><param name='_ExtentY' value='794'><param name='AUTOSTART' value='-1'><param name='SHUFFLE' value='0'><param name='PREFETCH' value='0'><param name='NOLABELS' value='0'><param name='CONTROLS' value='controlpanel'><param name='CONSOLE' value='_master'><param name='LOOP' value='0'><param name='NUMLOOP' value='0'><param name='CENTER' value='0'><param name='MAINTAINASPECT' value='0'><param name='BACKGROUNDCOLOR' value='#000000'><param name='SRC' value='"+strURL+"'></object>";
    break;
   case "MID":
    tmpstr="<object classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902' type='application/x-oleobject' standby='Loading...' width="+intWidth+" height="+intHeight+"><param name='FileName' value='"+strURL+"'><param name='ShowStatusBar' value='-1'><param name='EnableContextMenu' value='0'><param name='VideoBorder3D' value='0'><param name='Volume' value='0'><param name='AutoStart' value='true'><embed type='application/x-mplayer2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' SRC='"+strURL+"' AutoStart=true width="+intWidth+" height="+intHeight+"></embed></object>";
    break;
   case "QT":
    tmpstr="<embed src='"+strURL+"' autoplay='true' Loop='false' controller='true' playeveryframe='false' cache='false' scale='TOFIT' bgcolor='#000000' kioskmode='false' targetcache='false' pluginspage='http://www.apple.com/quicktime/'>";
    break;
   case "RA":
    tmpstr="<object classid='clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA' id='RAOCX' width='"+intWidth+"' height='"+intHeight+"'><param name='_ExtentX' value='6694'><param name='_ExtentY' value='1588'><param name='AUTOSTART' value='0'><param name='SHUFFLE' value='0'><param name='PREFETCH' value='0'><param name='NOLABELS' value='0'><param name='SRC' value='"+strURL+"'><param name='CONTROLS' value='StatusBar,ControlPanel'><param name='LOOP' value='0'><param name='NUMLOOP' value='0'><param name='CENTER' value='0'><param name='MAINTAINASPECT' value='0'><param name='BACKGROUNDCOLOR' value='#000000'><embed src='"+strURL+"' width='253' autostart='true' height='60'></embed></object>";
    break;
   case "QT":
    tmpstr="<embed src='"+strURL+"' autoplay='true' Loop='false' controller='true' playeveryframe='false' cache='false' scale='TOFIT' bgcolor='#000000' kioskmode='false' targetcache='false' pluginspage='http://www.apple.com/quicktime/'>";
  }
  document.getElementById(strID).innerHTML = tmpstr;
 }
}
</script>
</head>
<body>
<!--把下面代码加到<body>与</body>之间-->
<input id="VOBJ_1" type="hidden" value="-1"><a href="javascript:UBBShowObj('SWF','OBJ_1','http://www.zhengshili.com/swf/feisan.swf','650','400');"><img src="http://www.zhengshili.com/tupian/icon_flash.gif" alt="显示Flash文件" align="absmiddle" border="0">点击显示/隐藏内容</a><div id="OBJ_1"></div>
</body>
</html>



显示Flash文件点击显示/隐藏内容
 

标签:网页 代码 隐藏 打开 关闭 











 




出处:正势利工作室

网址:http://www.zhengshili.com 正势利 转载时请注明出处和网址

作者QQ及微信:49922779 点击这里给我发消息

相关评论
QQ交流群:120100441    QQ客服:49922779 闽ICP备01008686号