I have following jquery:
$(window).resize(function () { changeIframe(); });
$(“#iFrame”).load(function () { changeIframe(); });
function changeIframe() {
var iFHeight = $('iFrame').contents().height();
var iFWidth = $('iFrame').contents().width();
$("#content").css("height", iFHeight);
$("#content").css("width", iFWidth);
}
Problem i am having is: When we click on menu first iframe of height 100px loads(this works fine). Then we load another iframe by clicking another menu 500px iframe loads(this also works fine makes height to 500px). But when i click back on menu link for 100px iframe, size is still 500px in height. It does not adjust. I cant figure out what am i doing wrong.
You would have to remove height before adding new height use below code
$(‘#content’).removeAttr(“height”);