Results 1 to 6 of 6

Thread: [DHTML] Menu using prototype.js

  1. #1
    Join Date
    Feb 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default [DHTML] Menu using prototype.js

    1) CODE TITLE:
    How to build a DHTML Menu using prototype.js framework
    2) AUTHOR NAME/NOTES:
    Sujoy Kumar Roy
    3) DESCRIPTION:
    Using the robust framework like Prototype.js one can build DHTML menu with very ease.
    4) URL TO CODE:
    http://www.brightsoftsolutions.com/a...dhtml-menu.php


    Happy coding.

  2. #2
    Join Date
    Dec 2007
    Location
    Ankara, Turkey
    Posts
    160
    Thanks
    2
    Thanked 2 Times in 2 Posts

    Default

    Nice work but there are some issues which has to be improved as you say on the page.

    For example you should consider adding an auto-hide feature with a timeout

  3. The Following User Says Thank You to BYK For This Useful Post:

    sujoykroy (03-11-2008)

  4. #3
    Join Date
    Feb 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Sorry, i didn't visit the thread for quite some time. You are right, i realized that. But instead of a timeout, i added another event handler. Like below,

    PHP Code:
    Event.observe(document,"mouseover",function(event){
      var 
    elt = $(Event.element(event));
         if (!
    elt.descendantOf($('my_menu')) && $$('.selected_item').length>0) {
        $(
    'my_menu').select('ul').invoke('hide');
        $$(
    '.selected_item').invoke('removeClassName','selected_item');
         }        
    }); 
    This will track the mouseover events that occurs outside the drop menu and hide it.

  5. #4
    Join Date
    Dec 2007
    Location
    Ankara, Turkey
    Posts
    160
    Thanks
    2
    Thanked 2 Times in 2 Posts

    Default

    I don't know if you have updated the example page but it does not seem to work. By the way the method you used is good but hiding the menus immediately is not very user-firendly in my opinion.

  6. #5
    Join Date
    Feb 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    The example page is not updated yet. But you can see an working example here
    http://070suj.basil.hostingrails.com/

    I will update the example page and post a update here.

  7. #6
    Join Date
    Dec 2007
    Location
    Ankara, Turkey
    Posts
    160
    Thanks
    2
    Thanked 2 Times in 2 Posts

    Default

    Alright, and one more comment

    I think you should make the sub menus appear a bit shifted. I mean they shouldn't appear on top of other main menu items, at least I should be able to see the beginnings of the main menu items.

    It might be done with some margin I think, right?

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
  •