SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru
    Join Date
    Aug 2001
    Location
    Amsterdam
    Posts
    788
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    IE function in Mozilla

    Getting this function to work in more browsers than only ie....

    Does anyone have a clue if I can get this function to work in Netscape and mozilla

    Code:
    <script language="javascript">
    <!--
     function expand(listID) {
            if (listID.style.display=="none")
    			{
    				listID.style.display="";
    			}
            else 
    			{
    				listID.style.display="none";
    			}
    }
     //--> </SCRIPT>
    Thanks

    Peanuts
    the neigbours (free) WIFI makes it just a little more fun

  2. #2
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's a function I use that performs a very similar task. I'll use the PHP tags here for the comment coloring, but the code is regular JS
    PHP Code:
    function toggleDisp(node) {
        if (
    is_ie4up// Sniffer variable
            
    node.style.display = (node.currentStyle.display == 'none') ? 'block' 'none';
        else if (
    is_gecko) { // Sniffer variable
            
    node.style.display = (node.style.display == 'none' || node.style.display == '') ? 'block' 'none';
            }
        else
            
    alert('Your browser does not have the javascript support for these menu featuers.\nPlease upgrade to the most recent version of Internet Explorer, Netscape, or Mozilla.');
        } 
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  3. #3
    SitePoint Guru
    Join Date
    Aug 2001
    Location
    Amsterdam
    Posts
    788
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    where do you get the variables from to know if it's ie or something else??

    I now how to do that in PHP but not in js

    greets peanuts
    the neigbours (free) WIFI makes it just a little more fun

  4. #4
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I use this sniffer (err, parts of it anyway)
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev





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
  •