How to hide the div which has placed inside inner div using jquery
I have the following div structure,
<div id="fancybox-content">
<iframe....>
<html>
<body&g开发者_Python百科t;
<div class="main">
<div id="adminheader">...</div>
<div id="admininner">
<div class="admin-inner-bg">
<div class="left">-------</div>
</div>
</div>
</div>
</body>
</html>
</iframe>
</div>
how to hide the div which has the class left
.
Kindly help.
if the content of iframe is from the same domain you can do
add id to your iframe
<iframe id="youriframeID"...>
.
.
and access the div
with class
left as
$('#youriframeID').contents().find('div.left').hide();
else if the contents of the iframe are from a different domain you have to create a server side proxy
Edit(s)
you can try the following
$('#youriframeID').contents().find('div.left')[0].hide();
if that didn't work wrap the code in
$("#youriframeID").ready(function () {
$('#youriframeID').contents().find('div.left').hide();
}
this way the code will execute when the iframe is finished loading
jQuery has a hide function: http://api.jquery.com/hide/
$('.left').hide();
$("#fancybox-content .left").get().hide();
Thanks all your support,
I got it by working,
<script type="text/javascript">
$('#fancybox-frame').ready(function(){
$('.left').hide();
});
</script>
精彩评论