Results 1 to 3 of 3

Thread: Drill Down Menu Trigger Function on Back

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

    Default Drill Down Menu Trigger Function on Back

    1) Script Title: Drill Down Menu

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

    3) Describe problem:

    I am using the DD Menu as sort of a database navigation tool. There are two panes displaying navigation items and a 3rd pane displaying results. For example, if the panes were used to navigate types of pictures the three frames would be:

    Left: Animals\Puppies, Kitties, Turtles
    Middle: Activities\Eating, Playing,
    Right: List of links to pictures.

    So if a user picked Puppies and Eating, the right would show links to pictures of puppies eating. I have that all working, the only problem is that I have no way to clear the selection. To continue my example, when a user hits back after selecting Activities -> Eating, my list doesn't update.

    What I need is a way to trigger a function on the back click. Any ideas how to do that?

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Try the below modified .js file. It lets you define a custom onnavback() function, which is executed each time the user navigates back within the drill down menu. For example, something like:

    Code:
    <script type="text/javascript">
    
    var mymenu=new drilldownmenu({
    	menuid: 'drillmenu1',
    	menuheight: 'auto',
    	breadcrumbid: 'drillcrumb',
    	persist: {enable: true, overrideselectedul: true}
    })
    
    mymenu.onnavback=function(){
    alert(this.currentul)
    }
    
    </script>
    The code in red is new, whereby this.currentul used within the function will give you the index of the destination UL the user is navigating back to relative to the other ULs within the menu when flattened. The top UL will always return 0, the 2nd UL return 1 etc.
    DD Admin

  3. #3
    Join Date
    Apr 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Wow thanks for the quick response. I'll give that a try and let you know how it all turns out.

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
  •