SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,122
    Mentioned
    29 Post(s)
    Tagged
    2 Thread(s)

    Hiding / Showing div not working in IE

    Hi,

    I have a gallery page here that uses javascript to hide / show divs of the larger image with a description.
    http://www.yellowshoe.com.au/alistair_temp/gallery.htm

    It works how I would like it to in Firefox but in IE nothing changes when I hover over the small images. When I change the CSS I can see that the divs are positioned correctly but the javascript isn't making them show up fopr some reason.

    Any ideas?

  2. #2
    SitePoint Enthusiast saadatshah's Avatar
    Join Date
    Jul 2002
    Location
    Lahore, Pakistan
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In your document there are two JS functions:

    HTML Code:
    function showDiv(id) 
    {
    oDiv = document.getElementById(id);
    oDiv.style.visibility = " visible";
    }
    function hideDiv(id)
    {
    oDiv = document.getElementById(id);
    oDiv.style.visibility = " hidden";
    }
    You put a space before the words "visible" and "hidden" jus remove it the code should go like:

    HTML Code:
    function showDiv(id)
    {
     oDiv = document.getElementById(id);
     oDiv.style.visibility = "visible";
    } 
    function hideDiv(id)
    {
     oDiv = document.getElementById(id);
     oDiv.style.visibility = "hidden";
    }
    Traffic School - Driver Ed - Defensive Driving
    Texas Defensive Driving - Online Traffic School
    Real Estate License
    Science is organized knowledge. Wisdom is organized life.

  3. #3
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,122
    Mentioned
    29 Post(s)
    Tagged
    2 Thread(s)
    ohh, thanks for that..

    Is that just for javascript or should my CSS rules never contain spaces?

  4. #4
    SitePoint Evangelist borna's Avatar
    Join Date
    Jun 2006
    Location
    Iran, Tehran
    Posts
    475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what is the efficient solution for the following case of this question:

    "Change the showDiv function to automatically show some results which are directly come from database."
    -1/2=999?

  5. #5
    SitePoint Evangelist borna's Avatar
    Join Date
    Jun 2006
    Location
    Iran, Tehran
    Posts
    475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wink After loading=onmousout ??

    Quote Originally Posted by markbrown4
    Hi,

    I have a gallery page here that uses javascript to hide / show divs of the larger image with a description.
    http://www.yellowshoe.com.au/alistair_temp/gallery.htm

    It works how I would like it to in Firefox but in IE nothing changes when I hover over the small images. When I change the CSS I can see that the divs are positioned correctly but the javascript isn't making them show up fopr some reason.

    Any ideas?
    Hi!

    Your web-page looks nice. May I ask you of

    Code:
    function MM_reloadPage(init) {  //reloads the window if Nav4 resized
      if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
        document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
      else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
    }
    MM_reloadPage(true);
    Is it supposed to, for the first time or more generally each time that your page loads, hide the original( the bigger picture) or not. Your code obeys such rule.
    -1/2=999?

  6. #6
    SitePoint Evangelist borna's Avatar
    Join Date
    Jun 2006
    Location
    Iran, Tehran
    Posts
    475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what is the default for onmousover and onmousout?

    Why I recieve the case for onmousout.

    I mean I set some part would be shown whenever i clik on some icon.

    But when my page loads or i refresh it, it gets to be shown. should i add some code at somewhere.?!
    -1/2=999?


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
  •