SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2001
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    showing & hiding layers in N4

    Hi

    Ive managed to get the spans display hidden and visible in IE5 & N6 the span is first hidden using display: none then through function i have

    document.getElementById('test').style.display='block'

    but what code do you use to get it to work in N4.7
    i know it involves the layer tag but how do you do it?
    I can manage it if I let dreamweaver do the code but the code is a mess and sooo long its undecipherable .. there must be an easier way!

    cheers chris

  2. #2
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well I don't think display works in nn4.7 you would have to use the visibility='whatever' selection for one thing.

    You don't even have to use the layer tag. Netscape doesn't mind divs.

    GOOD BROWSERS
    document.getElementById('bob').style.visibility='visible';

    BAD BROWSER
    document.layers['bob'].visibility='visible';
    Last edited by Maelstrom; Apr 10, 2002 at 19:59.
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.

  3. #3
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sitepoint uses this

    PHP Code:

    function expand(listID) {
            if (
    listID.style.display=="none") {
                    
    listID.style.display="";
            }
            else {
                    
    listID.style.display="none";
            }
            
    window.event.cancelBubble=true;
    }
    function 
    contract(listID) {
            if (
    listID.style.display=="show") {
                    
    listID.style.display="";
            }
            else {
                    
    listID.style.display="none";
            }
            
    window.event.cancelBubble=true;

    however use a browser detect script to make it valid in netscape as Maelstrom said use

    visible


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
  •