...

View Full Version : auto height iframe for Expandable content????



Taus
01-29-2009, 01:12 AM
hi all,

I loading my website in iframe i have put Javascript for auto height, but in my iframe expendable / Collapsible bar is there when page load into javascript my bar is Collapsible so it takes auto height correct but when i expand my Collapsible bar my content is overlapping please give me the solution and i don't want scroll bar for iframe when
content expand here is my page:

http://www.palindromesoftware.com/Ritecart/ver8/home.html

and here JavaScript which is i am using:

<script type="text/javascript">
function doIframe(){
o = document.getElementsByTagName('iframe');
for(i=0;i<o.length;i++){
if (/\bautoHeight\b/.test(o[i].className)){
setHeight(o[i]);
addEvent(o[i],'load', doIframe);
}
}
}
function setHeight(e){
if(e.contentDocument){
e.height = e.contentDocument.body.offsetHeight + 10;
alert(e.height);
} else {
e.height = e.contentWindow.document.body.scrollHeight;
}
}

function addEvent(obj, evType, fn){
if(obj.addEventListener)
{
obj.addEventListener(evType, fn,false);
return true;
} else if (obj.attachEvent){
var r = obj.attachEvent("on"+evType, fn);
return r;
} else {
return false;
}
}

if (document.getElementById && document.createTextNode){
addEvent(window,'load', doIframe);
}
</script>

rangana
01-29-2009, 04:40 AM
Might help:
http://www.dynamicdrive.com/dynamicindex17/iframessi2.htm

Taus
01-29-2009, 05:32 PM
thanks buddy but this one not working i am getting same problem



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum