How can I:
- Wait for an external iFrame to load
- Resize externally sourced iFrame (ex: 100px x 40px)
- Offset externally sourced iFrame (ex: 25px x 50px)
Sample code:
<html>
<body>
<p>Here's Google's Logo Today:</p>
<iframe id="google_logo" src="http://www.google.com/search?q=stackoverflow"></iframe>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {});
</script>
</body>
</html>
I know you can’t get contents of external iFrame, but what about resizing and offsetting?
I also know my example is ridiculous.
You can’t fire an event when an external iframe has fully loaded, the rest is possible though.
Wrap the frame in a div
Add the following jQuery
Add the following CSS