Search code examples
javascriptjqueryhtmlcssframeset

Hiding frame after set amount of time?


I have a page made up of 2 frames (not iframes).

How to achieve that: the top frame will disappear (or appear to disappear) by shrinking upwards after x seconds? As it disappears, I'd like for the second frame to move up so there is no top bar left.


Solution

  • You could use jQuery to do that with something along these lines

    function hideFrame()
    {
        $('#framename').slideUp(1000);
    }
    

    Then you could use a timeout function to call this:

    setTimeout('hideFrame()', 5000); // Change 5000 to whatever you like in milliseconds...
    

    And remember to change '#framename' to whatever yours is called like for an example:

    <div id="framename">blah blah</div>
    

    Hope this helps.

    (Just noticed you put 'not iframes'...)