DHTML
  Home arrow DHTML arrow Page 2 - YADM-Yet Another Dynamic Menu
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  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
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? 
DHTML

YADM-Yet Another Dynamic Menu
By: Christian Heilmann
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 16
    2004-10-13

    Table of Contents:
  • YADM-Yet Another Dynamic Menu
  • Using YADM -- Changing the Look and Feel
  • How it Works
  • Working with other Scripts, and What it Does Not Do

  • 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


    YADM-Yet Another Dynamic Menu - Using YADM -- Changing the Look and Feel


    (Page 2 of 4 )

    YADM enhances a nested list (UL) in the markup, and it applies different classes to the elements when they become "interactive".

    The markup has to be something like this:

    <ul id="nav">
     <li><a href="index.html">Home/News</a></li>
     <li><a href="examples.html">Examples</a>
      <ul>
       <li><a href="dropdown.html">Absolute Dropdown</a></li>
       <li><a href="reldropdown.html">Relative Dropdown</a></li>
       <li><a href="flyout.html">Flyout menu</a></li>
       <li><a href="expanding.html">Expanding Menu</a></li>
       <li><a href="others.html">Submitted examples</a></li>
      </ul>
     </li>
     <li><a href="report.php">Contribute</a></li>
     <li><a href="using.html">Using YADM</a>
      <ul>
       <li><a href="using.html#css">Changing look and feel</a></li>
       <li><a href="using.html#js">How it works</a></li>
       <li><a href="using.html#other">Working with other scripts</a></li>
       <li><a href="using.html#not">What it does not do</a></li>
      </ul>
     </li>
    </ul>

    All YADM needs is the nav ID on the first UL. You can change this ID to something else in the script, if necessary. If you don't want YADM to apply hover states to the list (for example when creating an expanding and collapsing menu), add a class called nohover to the nav UL:

    <ul id="nav" class="nohover">
    [...]
    </ul>

    If you don't want one of the nested lists to be collapsed, add a class called current to either the LI containing the list, or any of its elements.

    <ul id="nav">
     <li><a href="index.html">Home/News</a></li>
     <li><a href="examples.html">Examples</a>
      <ul>
       <li><a href="dropdown.html">Absolute Dropdown</a></li>
       <li class="current"><a href="reldropdown.html">Relative Dropdown</a></li>
       <li><a href="flyout.html">Flyout menu</a></li>
       <li><a href="expanding.html">Expanding Menu</a></li>
       <li><a href="others.html">Submitted examples</a></li>
      </ul>
     </li>
     <li><a href="report.php">Contribute</a></li>
    [...]
    </ul>

    To achieve the functionality of showing and hiding the nested lists, YADM applies different classes to the elements. This means you can control the look and the way the elements are hidden completely in CSS:

    Applied classes

    Class nameelementdesired effect
    dhtmlmain ULindicates when JavaScript/DOM is available, you can use this class to differentiate the presentation of the UL. For example UL#nav{width:auto;} and UL#nav.dhtml{width:10em;}
    isParentany LI containing a nested listindicates that this LI contains a menu and is not just a link. In the above example this class adds the downward arrows.
    isActiveLI containing the currently visible nested listindicates the current open menu item, in this case here it changes the background of the LI to a light yellow.
    hiddenChildall nested lists (UL element)hides the element, apply any CSS technique you want (off-left, or display:none or or or).
    shownChildcurrently active nested list (UL element)shows the currently active nested list.

    Check the examples page to see how you can use these classes.

    You can change the name of these classes in the variable section of the script.

    More DHTML Articles
    More By Christian Heilmann


       · Nice menu, I want to use this one, but are there some sample menu's?SO I can...
       · The [url=http://www.onlinetools.org/tools/yadm/]YADM homepage[/url] has loads of...
       · http://www.onlinetools.org/tools/yadm/examples.html is the URL.
       · implementing this one a few new sites.if i get a chance, i'll submit a sample:...
     

    DHTML ARTICLES

    - Text-Justify, Volume, and Other Style Sheet ...
    - Ruby-Position, Size, and Other Style Sheet P...
    - Padding, Pages, and More Style Sheet Propert...
    - Marks, Orphans, and More Style Sheet Propert...
    - Layouts, Margins, and Other Style Sheet Prop...
    - Floats, Fonts, and Other Style Sheet Propert...
    - Color, Filters, and Other Style Sheet Proper...
    - Borders and More with Style Sheets
    - Learning Style Sheet Properties
    - Style Sheet Property Reference
    - Completing a Noisy Image Application
    - An Object-Based Approach to Building Noisy I...
    - A Basic Method for Building Noisy Images
    - Adding More Features to Sliders with the Scr...
    - Using Sliders with the Scriptaculous Framewo...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    Stay green...Green IT