javascript - added js code doesn't work in iframe -
i have iframe containing div tag "firstheadsection" id.
after iframe loaded, append code iframe:
<script> $(window).on("resize", function(){ alert($("#firstheadsection").height()) }) </script>
the js code inserted after resize window, alerts null.
jquery included in iframe.
what should do?
you have access main page, have prepend "parent". try this: (not tested)
parent.$.fn.resize(function() { alert($("#firstheadsection").height()); });
Comments
Post a Comment