怎么用js来设置这个iframe属性谢谢啦
'<iframesrc="index.html"scrolling="no"frameborder="0"style="position:fixed;bottom:0;r...
'<iframe src="index.html" scrolling="no" frameborder="0" style="position:fixed;bottom:0;right:0;width:305px;height:320px;"></iframe>');
改成用js代码设置上面的iframe的属性,谢谢呢
window.onload= function(){
var ir = document.createElement('iframe');
ir.src="index.html";
var bo = document.getElementsByTagName('body')[0];
bo.appendChild(ir);
} 展开
改成用js代码设置上面的iframe的属性,谢谢呢
window.onload= function(){
var ir = document.createElement('iframe');
ir.src="index.html";
var bo = document.getElementsByTagName('body')[0];
bo.appendChild(ir);
} 展开
1个回答
展开全部
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8" />
<title>last.html</title>
<style>
</style>
<script type="text/javascript">
window.onload = function ()
{
var iframe = document.createElement ('iframe');
iframe.src = "index.html";
iframe.setAttribute("scrolling", "no");
iframe.setAttribute("frameborder", 0);
iframe.style.position = "fixed";
iframe.style.bottom = 0;
iframe.style.right = 0;
iframe.style.width = "305px";
iframe.style.height = "320px";
document.body.appendChild (iframe);
}
</script>
</head>
<body>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询