SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    May 2002
    Location
    Montreal
    Posts
    126
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Show/Hide Layer problems with Firefox

    I have a Show/Hide script that works fine with IE7 and Safari but NOT Firefox. The error (in FireFox Javascript Console) is "viaCourriel is not defined". Any ideas?

    <script>
    function openCourriel()
    {
    viaCourriel.style.display="block";
    viaPost.style.display="none";
    }
    </script>

    <a href="javascript: openCourriel();">Courriel</a>

    <div id="viaCourriel" style="display:none;">
    Contents here.
    </div>
    Mark Dixon
    Freelance Web Designer and Developer
    www.markdixon.ca
    Montreal, Quebec, Canada


  2. #2
    Awesome Addict
    Join Date
    Mar 2004
    Location
    Toronto, Canada
    Posts
    326
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try
    Code:
         
         <script>
         function openCourriel()
         {
         document.getElementById("viaCourriel").style.display="block";
         document.getElementById("viaPost").style.display="none";
         }
         </script>
         
         <a href="javascript: openCourriel();">Courriel</a>
         
         <div id="viaCourriel" style="display:none;">
         Contents here.
          </div>

  3. #3
    SitePoint Zealot
    Join Date
    May 2002
    Location
    Montreal
    Posts
    126
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks gregor002, it works. i could have sworn that i tried it before and it didn't work ...

    thanks!
    mark
    Mark Dixon
    Freelance Web Designer and Developer
    www.markdixon.ca
    Montreal, Quebec, Canada



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
  •