Advanced Search

Results 1 to 5 of 5

Thread: Ajax Tabs Content Script (v 2.2) IFRAME AutoResize HELP!!

  1. #1
    Join Date
    Jun 2008
    Posts
    21
    Thanks
    0
    Thanked 1 Time in 1 Post

    Question Ajax Tabs Content Script (v 2.2) IFRAME AutoResize HELP!!

    1) Script Title: Ajax Tabs Content Script (v 2.2)

    2) Script URL (on DD): Ajax Tabs Content Script (v 2.2)

    3) Describe problem: I am currently using the Iframe feature, but I was just wondering or is there any possibility on adding a autoresize (height resize) feature in to expand the iframe when the content is too much, I want to avoid using the scroll function. PLEASE SOMEONE HELP!!!!
    Last edited by jrheeder; 06-30-2008 at 04:36 PM.

  2. #2
    Join Date
    Aug 2004
    Posts
    9,862
    Thanks
    3
    Thanked 959 Times in 948 Posts
    Blog Entries
    15

    Default

    You may want to do a search on the forums, as this has been asked a few times, and there are a couple of user suggestions I believe on how to do this. Officially there's no modification released to do this yet. There is a mod that lets you manually specify a different IFRAME height depending on the tab: http://www.dynamicdrive.com/forums/s...d.php?p=132566

  3. #3
    Join Date
    Jun 2008
    Posts
    21
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Quote Originally Posted by ddadmin View Post
    You may want to do a search on the forums, as this has been asked a few times, and there are a couple of user suggestions I believe on how to do this. Officially there's no modification released to do this yet. There is a mod that lets you manually specify a different IFRAME height depending on the tab: http://www.dynamicdrive.com/forums/s...d.php?p=132566
    DD,

    Thank you for the response. Now unfortunately my strengths are not in javascript so for me to edit the original .js file from the Ajax tab file to include the code (attached below) from Iframe SSI script II is past my knowledge and I fear that it will go wrong. . . So if you or anyone can show me how and where is add this code so it can work properly with the original Ajax tab setup, I REALLY would appreciate it.

    The code:
    Code:
    <script type="text/javascript">
    
    /***********************************************
    * IFrame SSI script II-  Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
    * Visit DynamicDrive.com for hundreds of original DHTML scripts
    * This notice must stay intact for legal use
    ***********************************************/
    
    //Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
    //Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
    var iframeids=["myframe"]
    
    //Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
    var iframehide="yes"
    
    var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
    var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers
    
    function resizeCaller() {
    var dyniframe=new Array()
    for (i=0; i<iframeids.length; i++){
    if (document.getElementById)
    resizeIframe(iframeids[i])
    //reveal iframe for lower end browsers? (see var above):
    if ((document.all || document.getElementById) && iframehide=="no"){
    var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
    tempobj.style.display="block"
    }
    }
    }
    
    function resizeIframe(frameid){
    var currentfr=document.getElementById(frameid)
    if (currentfr && !window.opera){
    currentfr.style.display="block"
    if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
    currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; 
    else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
    currentfr.height = currentfr.Document.body.scrollHeight;
    if (currentfr.addEventListener)
    currentfr.addEventListener("load", readjustIframe, false)
    else if (currentfr.attachEvent){
    currentfr.detachEvent("onload", readjustIframe) // Bug fix line
    currentfr.attachEvent("onload", readjustIframe)
    }
    }
    }
    
    function readjustIframe(loadevt) {
    var crossevt=(window.event)? event : loadevt
    var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
    if (iframeroot)
    resizeIframe(iframeroot.id);
    }
    
    function loadintoIframe(iframeid, url){
    if (document.getElementById)
    document.getElementById(iframeid).src=url
    }
    
    if (window.addEventListener)
    window.addEventListener("load", resizeCaller, false)
    else if (window.attachEvent)
    window.attachEvent("onload", resizeCaller)
    else
    window.onload=resizeCaller
    
    </script>

  4. #4
    Join Date
    Jun 2008
    Posts
    21
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    No-one Has any idea how to combine these two features

  5. #5
    Join Date
    Aug 2004
    Posts
    9,862
    Thanks
    3
    Thanked 959 Times in 948 Posts
    Blog Entries
    15

    Default

    There's a reason why there isn't an official modification that integrates the two scripts right now- it's a rather complicated (not to mention less than elegant) task. This is a feature that if added, will only come when the script is officially updated the next time, and probably written from scratch instead of trying to piece two scripts together.

    In the meantime, if you need help implementing the more restricted feature in the thread I mentioned, you can post them here.

Bookmarks

Posting Permissions

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