0

i'm actually trying to do something new for me , and i'm not able to know if it's possible or not.

I have one Html page whit some iframe into. That i can't touch. I only have acces to the iframe. And i'd like to do a button into one of this iframe that will change the width of an element into another iframe.

I actually have this :

<!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>

i wish that the Expend() function is in another jsfile/Iframe and change the width of the element container of this iframe, is that possible ?

Thanks a lot sorry if my question isn't understable

Jeff
  • 7
  • 7
  • Possible duplicate of [Calling javascript function in iframe](http://stackoverflow.com/questions/1600488/calling-javascript-function-in-iframe) – Lucas Rodrigues Jan 14 '16 at 11:56
  • Nop , because he has 1 iframe into 1 html body , and i have 2 iframe that i want to make communicate into the same body. – Jeff Jan 14 '16 at 12:23
  • Add long as the container page and iframe pages are all on the same domain it should be possible – Jaromanda X Jan 14 '16 at 13:45
  • How would you do that so , because i cant use "document.getElementById("index").contentWindow.Expend();" , i want to use a function in an iframe , from another iframe. just that ... please :o – Jeff Jan 14 '16 at 14:08

0 Answers0