Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation auto height iframe for Expandable content????

    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/Ri...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>

  • #2
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph

  • #3
    New to the CF scene
    Join Date
    Jan 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks buddy but this one not working i am getting same problem


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •