Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Aug 2006
    Location
    Manchester, UK
    Posts
    2,016
    Tokens
    141
    Habbo
    florx

    Latest Awards:

    Thumbs up [TUT] Auto-Expanding Iframes.

    Hello! Thanks for attempting to read this load of mashed up html code and random speeches! So lets start.

    1) You need to put this code into your <head> tags:

    HTML Code:
    <script type="text/javascript">
    var iframeids=["content"]
    var iframehide="yes"
    var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
    var FFextraHeight=parseFloat(getFFVersion)>=0.1? 47 : 0
    /*
    Internet explorer seems to think it can make it's own rules about the internet.
    */
    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>
    2) You need to have an iframe with an id of content e.g.
    HTML Code:
    <iframe id="content"></iframe>
    Thats about it really. Any problems POST \/ :eusa_whis

    Thanks for reading.

    FlorX

  2. #2
    Join Date
    Apr 2005
    Posts
    4,614
    Tokens
    90

    Latest Awards:

    Default

    You forgot to credit DynamicDrive.

  3. #3
    Join Date
    Dec 2006
    Location
    Doncaster, UK
    Posts
    4,244
    Tokens
    0

    Latest Awards:

    Default

    Indeed.

    That code is illegal unless you include the DD copyright comments in the JS file.

    Hardly a tutorial anyway - c&p isn't a tutorial?
    A collection of forum users' views on obesity
    Quote Originally Posted by mynameisjake View Post
    sounds good
    Quote Originally Posted by Stephen View Post
    Just google it.
    Quote Originally Posted by jesus View Post
    jesus christ
    Quote Originally Posted by Alexicles. View Post
    It will probably soon go away.

  4. #4
    Join Date
    Mar 2005
    Posts
    6,366
    Tokens
    325

    Latest Awards:

    Default

    he's c&p a tutorial. so? give this guy some credit.

    and it's a code that could be used by anyone.
    Last edited by alexxxxx; 06-04-2007 at 08:42 AM.
    goodbye.

  5. #5

    Default

    This tutorial is available from DynamicDrive, thanks for putting it up but you should have left the credits.

    I highly recommend to any webmasters that you do NOT use this script as users with without Javascript will experience difficulty viewing your website!


  6. #6
    Join Date
    Dec 2006
    Location
    Doncaster, UK
    Posts
    4,244
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by [ALEX] View Post
    he's c&p a tutorial. so? give this guy some credit.

    and it's a code that could be used by anyone.
    He's breaching copyright - a lawyer wouldn't "give the guy some credit".
    A collection of forum users' views on obesity
    Quote Originally Posted by mynameisjake View Post
    sounds good
    Quote Originally Posted by Stephen View Post
    Just google it.
    Quote Originally Posted by jesus View Post
    jesus christ
    Quote Originally Posted by Alexicles. View Post
    It will probably soon go away.

  7. #7
    Join Date
    Nov 2006
    Location
    Cheshire.
    Posts
    730
    Tokens
    250

    Default

    As i have said many a time.

    "Respect4U = 0"


    Give us an add like!

  8. #8
    Join Date
    Jan 2006
    Location
    Cambridge
    Posts
    1,911
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by FlorX View Post
    Hello! Thanks for attempting to read this load of mashed up html code and random speeches! So lets start.

    1) You need to put this code into your <head> tags:

    HTML Code:
    <script type="text/javascript">
    var iframeids=["content"]
    var iframehide="yes"
    var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
    var FFextraHeight=parseFloat(getFFVersion)>=0.1? 47 : 0
    /*
    Internet explorer seems to think it can make it's own rules about the internet.
    */
    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>
    2) You need to have an iframe with an id of content e.g.
    HTML Code:
    <iframe id="content"></iframe>
    Thats about it really. Any problems POST \/ :eusa_whis

    Thanks for reading.

    FlorX
    it would be nice to know how to slice a compatible one also
    EDTALKING


  9. #9
    ScottDiamond Guest

    Default

    Quote Originally Posted by FlorX View Post
    Hello! Thanks for attempting to read this load of mashed up html code and random speeches! So lets start.

    1) You need to put this code into your <head> tags:

    HTML Code:
    <script type="text/javascript">
    var iframeids=["content"]
    var iframehide="yes"
    var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
    var FFextraHeight=parseFloat(getFFVersion)>=0.1? 47 : 0
    /*
    Internet explorer seems to think it can make it's own rules about the internet.
    */
    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>
    2) You need to have an iframe with an id of content e.g.
    HTML Code:
    <iframe id="content"></iframe>
    Thats about it really. Any problems POST \/ :eusa_whis

    Thanks for reading.

    FlorX
    Let me get started with my cup of tea.

    1) It's Javascript, not 'mashed up HTML'.
    2) The iFrame wont work as you have not included src="link" to display the content.
    3) Most important, it's DD's.
    4) Lol.

  10. #10
    Join Date
    Jul 2006
    Location
    England
    Posts
    610
    Tokens
    0

    Default

    Thats not auto expanding ifram
    The ifram code does not say "expanding"
    its just a load of JS making it expand.


Page 1 of 2 12 LastLast

Posting Permissions

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