SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Mar 2005
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cool Problem with DHTML

    Hi, I have a function in a external javascript file which is:

    Code:
    function show_information(id) {
    	if (document.getElementById)
    	{
    		document.getElementById(id).style.visibility='visible';
    	}
    }
    This doesn't work in any browser, I can get it working in IE if I just do

    Code:
    id.style.visibility='visible';
    But not at all any other way. I'm using a span tag around an image to call the mouseover and mouseout functions, on the mouseover function i'm calling the function above, and its basically opposite for mouseout, why isn't this working?

    Thanks

    Kev

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know why you don't use CSS for something this simple, but we need to see the HTML and the call to the function to be able to help you trouble-shoot. The JavaScript snippet looks fine to me.
    Birnam wood is come to Dunsinane


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
  •