The code when run works fine in Firefox but when in Chrome- it doesn't work at all- the #agree element from iframe cannot be hidden. How to fix it for Chrome?
Here's my simplified code:
<iframe src="blank.htm"></iframe>
<button id="btn">Toggle</button>
<script>
frame = null;
$('iframe').load(function()
{
frame = $('iframe').contents();
});
$('#btn').click(function()
{
var div = frame.find('#agree');
div.toggle();
});
</script>
<style>
iframe
{
width: 600px;
height: 1200px;
transform: scale(0.5);
}
</style>
And here you can test it: http://nitton.pl/chrome/