Skip to main content
May 16, 2008
Answered

Monitor size

  • May 16, 2008
  • 1 reply
  • 275 views
I seem to remember that CF8 has a function that provides the monitor display size. Can anyone shed some light on this? I want to dynamically set the height of an IFRAME.
    This topic has been closed for replies.
    Correct answer
    You can dynamically change the height and width of an iframe using javascript. I would search for javascript and resolution size, then make sure you are running it with an onload function.

    Once you have the correct height, you can run something like this to alter the iframe height:

    <script language="javascript">
    function changeframe()
    {
    var new_height = height_from_resolution_funtion;
    document.getElementById('myframe').height = new_height;
    }
    </script>

    ...

    <iframe src="page.html" width="200" height="200" name="myframe"></iframe>

    1 reply

    Correct answer
    May 16, 2008
    You can dynamically change the height and width of an iframe using javascript. I would search for javascript and resolution size, then make sure you are running it with an onload function.

    Once you have the correct height, you can run something like this to alter the iframe height:

    <script language="javascript">
    function changeframe()
    {
    var new_height = height_from_resolution_funtion;
    document.getElementById('myframe').height = new_height;
    }
    </script>

    ...

    <iframe src="page.html" width="200" height="200" name="myframe"></iframe>