Results 1 to 2 of 2

Thread: Drill Down Menu : How to select a specific ul on click of a button

  1. #1
    Join Date
    Apr 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Drill Down Menu : How to select a specific ul on click of a button

    1) Script Title: Drill Down Menu

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

    3) Describe problem: I have a button on click of which i get a ul id now i want my drill menu to go to that ul.
    I tried this

    Code:
        var mySlider;
    
        $(document).ready(function () {
    
            mySlider = new drilldownmenu({
                menuid: 'drillmenu1',
                breadcrumbid: 'drillcrumb',
                persist: { enable: true, overrideselectedul: true }
            });
    
            $('#button1').click(function(){
            mySlider.selectedul = 'UL_ID';
              });
        });
    Please help its kindda urgent.
    Last edited by jscheuer1; 04-28-2013 at 04:43 AM. Reason: Format

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,004
    Thanks
    44
    Thanked 3,199 Times in 3,161 Posts
    Blog Entries
    12

    Default

    Code:
        jQuery(document).ready(function($){
    
            var mySlider = new drilldownmenu({
                menuid: 'drillmenu1',
                breadcrumbid: 'drillcrumb',
                persist: { enable: true, overrideselectedul: true }
            });
    
            $('#button1').click(function(){
                $('#UL_ID').parent('li').find('a').eq(0).trigger('click');
            });
        });
    Or:

    Code:
        jQuery(document).ready(function($){
    
            var mySlider = new drilldownmenu({
                menuid: 'drillmenu1',
                breadcrumbid: 'drillcrumb',
                persist: { enable: true, overrideselectedul: true }
            });
    
            $('#button1').click(function(){
                mySlider.slidemenu($('#UL_ID').data('specs').order);
            });
        });
    Or, if you know the 0 based index of the UL you want:

    Code:
        jQuery(document).ready(function($){
    
            var mySlider = new drilldownmenu({
                menuid: 'drillmenu1',
                breadcrumbid: 'drillcrumb',
                persist: { enable: true, overrideselectedul: true }
            });
    
            $('#button1').click(function(){
                mySlider.slidemenu(2);
            });
        });
    Pick one, do not do two or all three, pick just one of the above methods. They each work by themselves.

    You can find out the zero based index of the UL by doing this (after the menu has initialized):

    Code:
    alert(jQuery('#UL_ID').data('specs').order);
    The browser cache may need to be cleared and/or the page refreshed to see changes.

    If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.
    Last edited by jscheuer1; 04-28-2013 at 07:16 AM. Reason: doc ready for noConflict mode and add two other ways, details
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Similar Threads

  1. Replies: 1
    Last Post: 02-04-2013, 04:02 PM
  2. Replies: 0
    Last Post: 02-17-2011, 01:42 AM
  3. Programming Go Button on Chained Select Menu
    By Goad in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 02-23-2009, 09:08 PM
  4. Disable right click on specific image
    By Lucifix in forum JavaScript
    Replies: 7
    Last Post: 02-21-2008, 10:15 AM
  5. no right click browser specific on Mac?
    By rob3rt in forum Dynamic Drive scripts help
    Replies: 4
    Last Post: 04-11-2005, 02:51 AM

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
  •