SunQuest
 
       Design Usability
  Home arrow Design Usability arrow Page 3 - Create Great JavaScript and CSS Menus Simp...
IBM developerWorks
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Actuate Whitepapers 
Moblin 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DESIGN USABILITY

Create Great JavaScript and CSS Menus Simply
By: Stephen Davies
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 5
    2007-09-18

    Table of Contents:
  • Create Great JavaScript and CSS Menus Simply
  • A Combo Box
  • Rollover Menu Example
  • Alternative Design Idea with CSS

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Create Great JavaScript and CSS Menus Simply - Rollover Menu Example


    (Page 3 of 4 )

    Now for the next part, I'll show you a more complex example but again, it can be followed and edited with ease. I shall explain the code again as it progresses. We'll create a rollover menu again with four links, and each rollover effect adds a different color to the menu item. This type of menu is quite popular and now a very commonplace menu system on the web. It has a very smooth design feel to it.

    <html>
    <script language="javascript">
    <!--

      function mouseover(menu,page){
       
    menu.style.background='#6633C0';
       
    description.innerHTML=page;
     
    }

      function mouseout(menu){
       
    menu.style.background='#663390'
       
    description.innerHTML='&nbsp;'
     
    }

    -->
    </script>
    <table cellpadding="2" cellspacing="0"width="100">
      <tr>
       
    <td id="item1" style="cursor:hand;background-color:#663399"
    onMouseOver="mouseover(item1,'')"onMouseOut="mouseout(item1)"
    onClick="location.href='page1.html'">
         
    <div align="center">Page 1</div>
       
    </td>
      </tr>
      <tr>
       
    <td id="item2" style="cursor:hand;background-color:#663399"
    onMouseOver="mouseover(item2,'')"onMouseOut="mouseout(item2)"
    onClick="location.href='page2.html'">
         
    <div align="center">Page 2</div>
       
    </td>
     
    </tr>
      <tr>
       
    <td id="item3" style="cursor:hand;background-color:#663399"
    onMouseOver="mouseover(item3,'')"onMouseOut="mouseout(item3)"
    onClick="location.href='page3.html'">
         
    <div align="center">Page 3</div>
       
    </td>
     
    </tr>
      <tr>
       
    <td id="item4" style="cursor:hand;background-color:#663399"
    onMouseOver="mouseover(item4,'')"onMouseOut="mouseout(item4)"
    onClick="location.href='page4.html'">
         
    <div align="center">Page 4</div>
       
    </td>
     
    </tr>
      <tr>
       
    <td id="item5" style="cursor:hand;background-color:#663399"
    onMouseOver="mouseover(item5,'')"onMouseOut="mouseout(item5)"
    onClick="location.href='page5.html'">
         
    <div align="center"></div>
       
    </td>
     
    </tr>
     
    <tr>
       
    <td><font id="description"size="1"></font></td>
     
    </tr>
    </table>
    </html>

    Replace the location.href URLs with the links required. The left hand menu result can be increased to hold many more menu items. These menus are great for the standard vertical menus for most types of sites. More links can be added; it is quite straightforward to edit.

    More Design Usability Articles
    More By Stephen Davies


       · This solution does not appear to work in IE6. The "popup" menus do not appear, and...
       · No only does this not work in ie - which is a bit of a drawback ! but the whole...
     

    DESIGN USABILITY ARTICLES

    - Create Great JavaScript and CSS Menus Simply
    - Design Principles that Shape a Web Site
    - Creating Aqua Style Images
    - Easy as A,B,C – dynamic A to Z indexes
    - EasyChart: a Usability Teaching Tool to Demo...
    - Building Friendly Pop-up Windows
    - Back to School: Design Usability
    - Using HTML_QuickForm To Manage Web Forms, Pa...
    - Using HTML_QuickForm To Manage Web Forms, Pa...
    - More Website Knick Knack
    - Browsers as Test Platforms
    - Website Knick Knack
    - Dynamic Page Elements-Cloak and Dagger Web D...
    - Accessibility and Dreamweaver MX 2004







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway