The Thematic Theme uses Superfish to manage multi-level drop-down menus. Overall this works very well but the default Superfish menu speed of “normal” is far to slow for my liking. Slow enough I feel people will miss the drops downs unless there is a visual clue the menu is expandable and if you have to explain your menu…
Options are to disable Superfish altogether (faster performance but no fancy menus) or modify Thematic’s menu code that controls menu speed. You may need to clear any WordPress caching and clear cached files from your browser when testing these changes.
Superfish jQuery information
Option 1 – Disable Superfish menu completely
- Open /library/extensions/header-extensions.php
- Move to the Head Scripts section on line 545 – ‘function thematic_head_scripts()’
- Move to the Superfish section “// load jquery and superfish… “
- Comment out lines 554, 555 and 556 by placing // in front of each line
1 2 3 4 | // load jquery and superfish associated plugins when theme support is active // if ( current_theme_supports( 'thematic_superfish' ) ) { // wp_enqueue_script( 'superfish', get_template_directory_uri() . '/library/js/superfish.min.js', array( 'jquery', 'hoverIntent' ), '1.7.4', true ); // } |
Option 2 – Modify Superfish menu speed
- Open /library/extensions/header-extensions.php
- Move to the Thematic Javascript Options section on line 562 – ‘$thematic_javascript_options = array’
- Change the Speed value on line 572 from ‘normal’ to ‘fast’ – ‘speed’ => ‘fast’, // speed of the opening animation. Equivalent to second parameter of jQuery’s .animate() method
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | function thematic_head_scripts() { $template = wp_get_theme( 'thematic' ); // load comment reply script on posts and pages when option is set and check for deprecated filter if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { has_filter( 'thematic_show_commentreply' ) ? thematic_show_commentreply() : wp_enqueue_script( 'comment-reply' ); } // load jquery and superfish associated plugins when theme support is active if ( current_theme_supports( 'thematic_superfish' ) ) { wp_enqueue_script( 'superfish', get_template_directory_uri() . '/library/js/superfish.min.js', array( 'jquery', 'hoverIntent' ), '1.7.4', true ); } // load theme javascript in footer wp_enqueue_script( 'thematic-js', get_template_directory_uri() . '/library/js/thematic.js', array( 'jquery' ), $template->Version, true ); $thematic_javascript_options = array( 'mobileMenuBreakpoint' => 600, 'superfish' => array( // These are the options for the superfish dropdown menus // see http://users.tpg.com.au/j_birch/plugins/superfish/options/ for more details 'animation' => array( 'opacity' => 'show', 'height' => 'show' ), // animation on opening the submenu 'hoverClass' => 'sfHover', // the class applied to hovered list items 'pathClass' => 'overideThisToUse', // the class you have applied to list items that lead to the current page 'pathLevels' => 1, // the number of levels of submenus that remain open or are restored using pathClass 'delay' => 400, // the delay in milliseconds that the mouse can remain outside a submenu without it closing 'speed' => 'fast', // speed of the opening animation. Equivalent to second parameter of jQuery’s .animate() method 'cssArrows' => false, // set to false if you want to remove the CSS-based arrow triangles 'disableHI' => false // set to true to disable hoverIntent detection ) ); |