Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Senior Member
    Join Date
    Apr 2003
    Location
    Hamden Ct
    Posts
    103
    Member #
    1121
    How can I make a <div> layer visible when I put my mouse over something? I know there's a way by changing the style of it, but I think that only works in IE.

  2.  

  3. #2
    Senior Member skrlin's Avatar
    Join Date
    Apr 2003
    Location
    Illinois
    Posts
    562
    Member #
    1063
    Try this out (works in NS and IE):
    Code:
    <script type="text/javascript">
    function overFunc(ele, state) {
     var theDiv = document.getElementById(ele);
     switch(state) {
    	case 'off':  theDiv.style.display = "none"; break;
    	case 'on': theDiv.style.display = "inline"; break;
     }
    }
    </script>
    
    <div style="display: none" id="div1">div content</div><BR>
    <table height="300" width="400">
    <tr>
    <td style="background-color: #0000FF; border-style: black 1px solid; width: 75px"
     onMouseOver="this.bgColor='red'; overFunc('div1','on')"
     onMouseOut="this.bgColor='blue'; overFunc('div1','off')">
    </td>
    </tr>
    </table>
    - Brian

  4. #3
    Senior Member
    Join Date
    Apr 2003
    Location
    Hamden Ct
    Posts
    103
    Member #
    1121
    thanks


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:21 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com