WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Problem while adding an action to the navigation menu of Theme Twentyeleven (4 posts)

  1. D X
    Member
    Posted 1 year ago #

    Hi,
    In the theme TwentyEleven, I want to add an action to the navigation menu. I wish the secondary menu to be displayed more slowly not suddenly as it is originally.

    So I write some jQuery sentences :

    $(document).ready(function(){
                      $("div.menu ul:first > li").mouseover(
                                            function(){
                                          $('ul',this).slideDown(400);
                                          }
                                            );
                      $("div.menu ul:first > li").mouseout(
                                                function(){
                                                $('ul',this).slideUp(200);
                                                }
                                                );
    })(jQuery);

    It does have a fonction on the navigation menu. However, it seems that the code that I add has a conflict with the original mechanism of displaying the secondary menu. Firstly the secondary menu will display very suddenly, after several tries, it gose as the way I want.

    I try to find a solution in the nav-menu-template.php, but it's really too complicated for me to understand the code in this file.

    So my question is that can anyone tell me :
    Where can I find the original code which controls the way of the secondary menu being displayed in the theme TwentyEleven.

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

    Twenty Eleven does not use JavaScript to control the navigation menu, it uses CSS.

  3. Andrew
    Forum Moderator
    Posted 1 year ago #

    Be sure to make your modifications through a Child Theme if you haven't already.

  4. D X
    Member
    Posted 1 year ago #

    Thank you for you reminding!
    I've never known there is Child Theme!

Topic Closed

This topic has been closed to new replies.

About this Topic