Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

from iframe page event change css of parent

I have homepage containing middle_overlay div which is initially not visible .Also , it contains"iframe capture" there is click button on page,on click event of button i want to make middle_overlay div visible, but from another page can i change how can i change css?

HTML:

<div id="middle_overlay">
</div>

<div id="middle">
    <iframe id="middle_frame" src="capture.php" frameborder='0' border='0' style="border:0;" seamless>
    </iframe>
</div> 

JQuery ::

$(document).ready(function()
{
$('#Monthly_Report').click(function(){
alert('monthly report clicked');
$('#middle_overlay').css('display','block');                                

});



});
like image 882
anam Avatar asked Jan 20 '26 00:01

anam


1 Answers

window.parent.$('#middle_overlay').css('display','block'); 

Note this will only work if your iframe and parent page are from the same domain.

like image 150
ED-209 Avatar answered Jan 22 '26 14:01

ED-209



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!