$(document).ready(function(){
iframeSize()
});
$("html").live("click", function( event ){
iframeSize()
});
$("html").live("keypress", function( event ){
iframeSize();
});
// resize dialog and iframe when contents change document height
function iframeSize(){
var iframeHeight = $(document).height();
window.parent.$('#loginLayer').attr('height', iframeHeight);
window.parent.$('#loginDialog').css('height', iframeHeight);
}
can this code be written more efficiently?
Thanks!
you can remove the ‘live’ and just do
only really need ‘live’ to tell jquery to recheck the DOM for a new element
( if a new element has been added to the page say with .append(), for example )
outside of this you might be able to achieve your iframe consistant dimensions by using a fluid layout in the parent via css / setting percentage heights and widths ( ? )