SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Hybrid View

  1. #1
    SitePoint Addict Mr Jojo's Avatar
    Join Date
    May 2007
    Posts
    322
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Simple hide/resize frame help

    I have 2 frames in this site: http://www.69noites.com/

    One is the site itself, the other is the "radio" frame.
    I want that the hides the radio's frame, so i made it like this:

    Code JavaScript:
    <a href="JavaScript: top.joana.cols = "0,*";"><img src="close.jpg"></a>

    The FrameSet code is this one:

    Code HTML4Strict:
    <frameset rows="92%,*" name="joana">
    	<frame name="header" scrolling="auto" target="main" src="portal.php">
    	<frame name="main" src="radio.php?r='.$radio.'" scrolling="no" target="main">
    	<noframes>
    	<body>
     
    	<p>This page uses frames, but your browser doesn\'t support them.</p>
     
    	</body>
    	</noframes>
    </frameset>


    Can you help me?

  2. #2
    SitePoint Enthusiast
    Join Date
    Nov 2006
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    One way is to put function in head of frameset page:
    Code JavaScript:
    <script type='text/javascript'>
    function resizeFrames(sets){
       var loc = document.getElementById('joana');
       loc.rows = sets;
    }
    </script>
    also add in frameset tag an attribute id='joana'
    and in Radio page change to:
    Code HTML4Strict:
    <a href="javascript: parent.resizeFrames('100%,');"><img src="close.jpg"></a>

  3. #3
    SitePoint Enthusiast
    Join Date
    Nov 2006
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To quote myself:
    Quote Originally Posted by bosko View Post
    also add in frameset tag an attribute id='joana'

  4. #4
    SitePoint Addict Mr Jojo's Avatar
    Join Date
    May 2007
    Posts
    322
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The script does exactly what i want

    But it only works on Internet Explorer, Its important that it could work on firefox.

    'Why cant they make a browser with no compatibility problems..'

    Is there anything that must be changed to work on mozilla?

    Anyway thanks!

  5. #5
    SitePoint Enthusiast
    Join Date
    Nov 2006
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, that's strange! I made it in Mozilla and then test in IE6&7 and Opera with success.

  6. #6
    SitePoint Addict Mr Jojo's Avatar
    Join Date
    May 2007
    Posts
    322
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe i've done something wrong :S

    Here's what i did:

    I putted <a href="javascript: parent.resizeFrames('100&#37;,');"><img src="close.jpg"></a>

    in the X button and the

    Code:
    <script type='text/javascript'>
    function resizeFrames(sets){
       var loc = document.getElementById('joana');
       loc.rows = sets;
    }
    </script>
    in the index.php file where the code is now:

    Code:
    <html>
    
    <head>
    <title>Noites...</title>
    <link rel="shortcut icon" href="69noites.ico" >
    
    <script type='text/javascript'>
    function resizeFrames(sets){
       var loc = document.getElementById('joana');
       loc.rows = sets;
    }
    </script>
    
    </head>
    
    <frameset rows="92%,*" name="joana">
    	<frame name="header" scrolling="auto" target="main" src="portal.php">
    	<frame name="main" src="radio.php?r=" scrolling="no" target="main">
    
    	<noframes>
    	<body>
    
    	<p>This page uses frames, but your browser doesn't support them.</p>
    
    	</body>
    	</noframes>
    </frameset>
    
    </html>

    Maybe you can have a better look watching the site's source www.69noites.com

  7. #7
    SitePoint Addict Mr Jojo's Avatar
    Join Date
    May 2007
    Posts
    322
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    LOL
    I thought id was the same as name.
    Stupid error from me xD


    Thanks! It works 100&#37; well!!


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
  •