How to hide a iframe with jquery. When user click on iframe (example iframe containing a google ADD ) it should hide without disturbing the iframe code. How can i achieve this with Jquery.
Thank You
How to hide a iframe with jquery. When user click on iframe (example iframe containing a google ADD ) it should hide without disturbing the iframe code. How can i achieve this with Jquery.
Thank You
I would have a link with id "toggle" right outside the iframe (on your page):
<a href="javascript:void(0);" id="toggle">-<span style="display:none">+</span></a>
Here's how you would link that up to hide the ad using jquery:
<script type="text/javascript">
$(function(){
var toggler=$("#toggle");
toggler.click(function(){
$("iframe").slideToggle('slow', function(){
// or specify a specific iframe using $("#iframe_id")
$("#toggle span").toggle();
});
});
});
</script>