Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: Help with frames

  1. #1
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Exclamation Help with frames

    Hi,

    I was wondering if you can hide and show frames (like a script)?

    Is it possible?
    Can you make it slide?

    Thanks in advance,

    ________

    Peter

  2. #2
    Join Date
    Mar 2006
    Posts
    600
    Thanks
    5
    Thanked 4 Times in 4 Posts

    Default

    Like this?
    I-Frame Scroller

    In this one you can take off the frame...
    Do this, take:

    Code:
    <script type="text/javascript">
    
    /***********************************************
    * IFRAME Scroller script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    
    //specify path to your external page:
    var iframesrc="external.htm"
    
    //You may change most attributes of iframe tag below, such as width and height:
    document.write('<iframe id="datamain" src="'+iframesrc+'" width="150px" height="150px" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="1" scrolling="no"></iframe>')
    
    </script>
    The highlited text, frameborder="1" Change it to frameborder=""
    Example with out a frame

    I think that what you want right?

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    How do you show and hide a script? Um, iframes may be shown or hidden in the usual manner for all HTML elements. There are many variations but the two basic methods are, to hide - set either the display style property to none or the visibility property to hidden. To reveal iframes hidden in these fashions set the display property to inline or the visibility property to visible, respectively:

    Code:
    <script type="text/javascript">
    function showHideEl(id){
    document.getElementById(id).style.visibility=document.getElementById(id).style.visibility=='hidden'? 'visible' : 'hidden';
    }
    </script>
    HTML Code:
    <iframe id='test'></iframe><br>
    <input type="button" value="Show/Hide" onclick="showHideEl('test')">
    The main difference between display and visibility is that setting display to none takes the element out of the flow of the document, not even reserving a spot for it, often causing the layout to shift. Setting visibility to hidden leaves the element in place as well as its spot in the document, you just can't see it.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    No, sorry I don't want iFrames.

    I mean like a frame in a frameset.

    I want to be able to press a button on another page and then the 'contents' frame to disappear. Not like just change the visibility, the display.

    And, if possible, to have a 'slide' effect.

    Sorry 'bout that

    ______________

    Peter

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    It's possible... but there are logic holes.

    changing the frameset onmouseover or something would be awkward... even with a click.

    Can you give a link or more info as to why this is the needed solution? It'll help make sense of the right method to do it as well.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  6. #6
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Arrow Reply: Hide/Show Frames

    Quote Originally Posted by djr33
    It's possible... but there are logic holes.

    changing the frameset onmouseover or something would be awkward... even with a click.

    Can you give a link or more info as to why this is the needed solution? It'll help make sense of the right method to do it as well.
    Hi,

    I need the solution for a web application I'm developing. I want the user to have the menu, and hide it so he can read the information. And, I'm not considering to use a JavaScript menu.

    And, if possible, to make a slide in effect (Like I said before) for more special effect.

    I don't need the Slide in Effect, but it would be nice if it was there

    For example, the contents page is on the left and the page is on the right. On the page there is a button saying [Hide/Show Menu]. When the user clicks the [Hide/Show Menu] button, the "contents" page hides. And when the user clicks the [Hide/Show Menu] button again, the menu shows.

    ______________

    Peter

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    There are better or more complete ways to do this but, for what you describe, this should work and is well documented:

    http://www.dynamicdrive.com/dynamici...llapsemain.htm
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. #8
    Join Date
    Mar 2006
    Posts
    600
    Thanks
    5
    Thanked 4 Times in 4 Posts

    Default

    oopps. My bad again. "brain Fart"!!

  9. #9
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Oh, right! OK!

    Thanks for the script

    But now just one more question?

    Can you make the frames slide in and out?

    Thanks for your help!


    ________________


    Peter

  10. #10
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Just applied the script and it works! (With a bit of adjusting)

    Now, can you make it slide in?

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
  •