Javascript函数转换为另一个文件
实际上,我正在尝试为自己做一些新的事情,但我不知道这是否可能 我有一个Html页面,其中包含一些iframe。我摸不到的。 我只有访问iframe的权限。我想在这个iframe中做一个按钮,将一个元素的宽度改变为另一个iframe 实际上我有:Javascript函数转换为另一个文件,javascript,iframe,Javascript,Iframe,实际上,我正在尝试为自己做一些新的事情,但我不知道这是否可能 我有一个Html页面,其中包含一些iframe。我摸不到的。 我只有访问iframe的权限。我想在这个iframe中做一个按钮,将一个元素的宽度改变为另一个iframe 实际上我有: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xm
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr">
<head>
<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<meta http-equiv="content-type" content="text/html; char=iso-8859-1">
<meta name="viewport" content="width=device-width, user-scalable=no"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
</head>
<body>
<a href="#" onClick="Expend();" ><div style='background: transparent url("http://slpubmedias.tf1.fr/test_nocache/test_jf/Gaumont/gaumont.png")no-repeat scroll 0% 0%' id="container"></div></a>
<style type="text/css">
body{
overflow-x: hidden;
overflow-y: auto;
margin: 0;
padding: 0;
width:100%;
height:1080px;
}
#container
{
width:15px;
height:15px;
}
</style>
<script>
function Expend()
{
document.getElementById('container').style.width="100%";
document.getElementById('container').style.height="100%";
screen.width;
}
</script>
</body>
</html>
身体{
溢出x:隐藏;
溢出y:自动;
保证金:0;
填充:0;
宽度:100%;
高度:1080px;
}
#容器
{
宽度:15px;
高度:15px;
}
功能扩展()
{
document.getElementById('container').style.width=“100%”;
document.getElementById('container').style.height=“100%”;
屏幕宽度;
}
我希望EXPLATE()函数位于另一个jsfile/Iframe中,并更改此Iframe的元素容器的宽度,这可能吗
非常感谢如果我的问题不可理解,很抱歉可能是Nop的重复,因为他有1个iframe到1个html正文,而我有2个iframe,我想在同一正文中进行通信。添加只要容器页面和iframe页面都在同一个域中,就应该有可能。您将如何这样做,因为我无法使用“document.getElementById(“index”).contentWindow.expense();“,我想在一个iframe中使用一个函数,从另一个iframe中使用。只是……请:o