I have a simple iFrame …
<iframe src="url" width="980px" height="90px" id="inviteFrame" name="inviteFrame" scrolling="no"></iframe>
I know I can’t catch click events on elements inside the frame but how about a simple click or mousedown on the iFrame itself?
$('#inviteFrame').click(function() {
console.log('test');
$(this).attr('height', '140px');
});
This doesn’t work for me!
jQuery has a method, called .contents(), that when used on an
iframeelement returns the document of the iframe.Now you can bind an event to it, get the dimensions, get styles of various elements, etc: