温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

多di公用一个css 按钮控制div 动态加载iframe 页面

发布时间:2020-07-08 09:53:50 来源:网络 阅读:393 作者:wzdouban 栏目:开发技术
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
<script language="JavaScript" type="text/JavaScript">
	
function showdiv(targetid,objN){
 var target=document.getElementById(targetid);
 var clicktext=document.getElementById(objN)
 if (target.style.display=="block")
 { target.style.display="none";
    clicktext.innerText="打开";
  } else { target.style.display="block"; clicktext.innerText='关闭';  }    
  iframe.src="http://www.baidu.com";
}
</script>
<style type="text/css">
#b1,#b2,#b3{ cursor: hand; cursor:pointer;}
#v1,#v2 ,#v3{width:100%;    height:300px }
.none { display: none; }
-->
</style>
 
</head>
<body>
 


 
<input id="b1" onclick="document.all.v1.innerHTML='<iframe src=\'http://www.sina.com\'></iframe>';showdiv('v1','b1');"type=button value=online1><br>  
<div id="v1" class="none"></div>

 
<input id="b2" onclick="document.all.v2.innerHTML='<iframe src=\'http://www.sina.com\'></iframe>';showdiv('v2','b2');"type=button value=online2><br>  
<div id="v2" class="none"></div>

 
 <textarea>
	 代码需要维护 src段不允许换行 空格
 </textarea>
</body>
</html>
</body>
</html>


向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI