Results 1 to 2 of 2

Thread: How to Make Selected SubMenu Disabled in Glossy Accordion Menu

  1. #1
    Join Date
    Aug 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to Make Selected SubMenu Disabled in Glossy Accordion Menu

    1) Script Title: Glossy Accordion Menu

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...enu-glossy.htm

    3) Describe problem: I would like to have the option or find a way to put the selected submenu disabled based on certain criteria. For example, different logged in user have different rights, so let's say the login user is normal user, then he shouldn't see certain submenus.

    Is this possible? How could I achieve that?

    Thanks.

    Regards,
    Jenson

  2. #2
    Join Date
    Aug 2004
    Posts
    9,878
    Thanks
    3
    Thanked 962 Times in 951 Posts
    Blog Entries
    15

    Default

    This is mostly a question of using server side scripting to selectively write out the HTML markup of the accordion menu based on what the currently logged in user is allowed to see (and not see). The pseudo code below demonstrates using PHP to display the 2nd sub menu when the user's id=5:

    Code:
    <div class="glossymenu">
    <a class="menuitem" href="http://www.dynamicdrive.com/">Dynamic Drive</a>
    <a class="menuitem submenuheader" href="http://www.dynamicdrive.com/style/" >CSS Examples</a>
    <div class="submenu">
    	<ul>
    	<li><a href="http://www.dynamicdrive.com/style/csslibrary/category/C1/">Horizontal CSS Menus</a></li>
    	<li><a href="http://www.dynamicdrive.com/style/csslibrary/category/C2/">Vertical CSS Menus</a></li>
    	<li><a href="http://www.dynamicdrive.com/style/csslibrary/category/C4/">Image CSS</a></li>
    	<li><a href="http://www.dynamicdrive.com/style/csslibrary/category/C6/">Form CSS</a></li>
    	<li><a href="http://www.dynamicdrive.com/style/csslibrary/category/C5/">DIVs and containers</a></li>
    	<li><a href="http://www.dynamicdrive.com/style/csslibrary/category/C7/">Links & Buttons</a></li>
    	<li><a href="http://www.dynamicdrive.com/style/csslibrary/category/C8/">Other</a></li>
    	<li><a href="http://www.dynamicdrive.com/style/csslibrary/all/">Browse All</a></li>
    	</ul>
    </div>
    <a class="menuitem" href="http://www.javascriptkit.com/jsref/">JavaScript Reference</a>
    <a class="menuitem" href="http://www.javascriptkit.com/domref/">DOM Reference</a>
    <?
    if ($userid==5){
    ?>
    <a class="menuitem submenuheader" href="http://www.cssdrive.com">CSS Drive</a>
    <div class="submenu">
    	<ul>
    	<li><a href="http://www.cssdrive.com">CSS Gallery</a></li>
    	<li><a href="http://www.cssdrive.com/index.php/menudesigns/">Menu Gallery</a></li>
    	<li><a href="http://www.cssdrive.com/index.php/news/">Web Design News</a></li>
    	<li><a href="http://www.cssdrive.com/index.php/examples/">CSS Examples</a></li>
    	<li><a href="http://www.cssdrive.com/index.php/main/csscompressor/">CSS Compressor</a></li>
    	<li><a href="http://www.dynamicdrive.com/forums/forumdisplay.php?f=6">CSS Forums</a></li>
    	</ul>
    	<img src="http://i27.tinypic.com/sy7295.gif" style="margin: 10px 5px" />
    </div>
    <?
    }
    ?>
    <a class="menuitem" href="http://www.codingforums.com/" style="border-bottom-width: 0">Coding Forums</a>		
    </div>
    The point being, this is a server side operation, and how exactly to go about it depends on how you're able to connect to your user database and output HTML selectively based on that.
    DD Admin

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
  •