SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast The Criminologist's Avatar
    Join Date
    Jun 2001
    Location
    Newtown, PA
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I'm playing "Hide the <div>"

    I am inserting html text with a <div> tag defining html code that will already exist below mine.

    I wish for this <div> tag to allow me to hide the excess junk below mY html and give the user an option to "turn" the <div> tag on and off. I accomplish this nicely, but when the information is turned "off", I am left with a giant space equivelant to the height of the junk I am trying to hide in place of it. Is there any option in the <div> tag that I can use to prevent this hue space from existing? It kinda makes my site look a little stupid!

    Any help would be appreciated.
    C:\DOS
    C:\DOS\RUN
    RUN\DOS\RUN
    When all else fails, use Percussive Maintenance!

  2. #2
    pg for mild peril cow's Avatar
    Join Date
    Mar 2000
    Location
    nevada, usa
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i'm not sure exactly how your page works...but you can define the div height to 0 whenever someone turns off the information.
    "There's no justice like angry mob justice!" --Seymour Skinner

  3. #3
    SitePoint Enthusiast The Criminologist's Avatar
    Join Date
    Jun 2001
    Location
    Newtown, PA
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok... could you please post the code for changing the div height as well as visibility? Here is the code as it exists now on the page:

    Code:
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    
    n = (document.layers) ? 1:0
    ie = (document.all) ? 1:0
    
    function init() {
    	if (n) block = document.blockDiv
    	if (ie) block = blockDiv.style
    }
    
    function show(showobj) {
    	if (n) showobj.visibility = "show"
    	else if (ie) showobj.visibility = "visible"
    }
    
    function hide(hideobj) {
    	if (n) hideobj.visibility = "hide"
    	else if (ie) hideobj.visibility = "hidden"
    }
    
    //-->
    </SCRIPT>
    And later on I make the call using javascript to hide and show the layer:

    Code:
    <A HREF="javascript:show(block)">View Options</A> - <A HREF="javascript:hide(block)">Hide Options</A>
    <BR>
    <DIV ID="blockDiv" STYLE="visibility:hidden;">

    How can I insert the height option here?
    C:\DOS
    C:\DOS\RUN
    RUN\DOS\RUN
    When all else fails, use Percussive Maintenance!

  4. #4
    pg for mild peril cow's Avatar
    Join Date
    Mar 2000
    Location
    nevada, usa
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm, i tried fiddling with the height property but it doesn't do anything if you have anything in between the div tags... i don't know how else to do it...anybody else know?
    "There's no justice like angry mob justice!" --Seymour Skinner

  5. #5
    SitePoint Zealot GregShasta's Avatar
    Join Date
    Jul 2001
    Location
    atlanta ga
    Posts
    122
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try using the display modifier instead of visibility. this is generally what i do however my pages are never netscape compatible.

    thx,
    Greg
    'I guess that my ambition was to be a bum'--robert mitchum


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
  •