我是这个社区的新手。
我最近将我的网站从WordPress 3.5.1升级到了4.6.1。看来superfish.js
因为我的菜单不能正常工作(没有平滑,没有延迟时间)。这个问题有什么解决办法吗?
这个theme-scrips.php
(由调用functions.php
) 是这样的:
<?php
function my_script() {
if (!is_admin()) {
wp_deregister_script(\'jquery\');
wp_register_script(\'jquery\', get_bloginfo(\'template_url\').\'/js/jquery-1.6.4.min.js\', false, \'1.6.4\');
wp_enqueue_script(\'jquery\');
wp_enqueue_script(\'modernizr\', get_bloginfo(\'template_url\').\'/js/modernizr.js\', array(\'jquery\'), \'2.0.6\');
wp_enqueue_script(\'superfish\', get_bloginfo(\'template_url\').\'/js/superfish.js\', array(\'jquery\'), \'1.4.8\');
wp_enqueue_script(\'easing\', get_bloginfo(\'template_url\').\'/js/jquery.easing.1.3.js\', array(\'jquery\'), \'1.3\');
wp_enqueue_script(\'prettyPhoto\', get_bloginfo(\'template_url\').\'/js/jquery.prettyPhoto.js\', array(\'jquery\'), \'3.1.3\');
wp_enqueue_script(\'nivo\', get_bloginfo(\'template_url\').\'/js/jquery.nivo.slider.js\', array(\'jquery\'), \'2.5.2\');
wp_enqueue_script(\'tools\', get_bloginfo(\'template_url\').\'/js/jquery.tools.min.js\', array(\'jquery\'), \'1.2.6\');
wp_enqueue_script(\'loader\', get_bloginfo(\'template_url\').\'/js/jquery.loader.js\', array(\'jquery\'), \'1.0\');
wp_enqueue_script(\'customFormElements\', get_bloginfo(\'template_url\').\'/js/custom-form-elements.js\', array(\'jquery\'), \'1.0\');
wp_enqueue_script(\'swfobject\', get_bloginfo(\'url\').\'/wp-includes/js/swfobject.js\', array(\'jquery\'), \'2.2\');
wp_enqueue_script(\'cycleAll\', get_bloginfo(\'template_url\').\'/js/jquery.cycle.all.js\', array(\'jquery\'), \'2.99\');
wp_enqueue_script(\'twitter\', get_bloginfo(\'template_url\').\'/js/jquery.twitter.js\', array(\'jquery\'), \'1.0\');
wp_enqueue_script(\'flickr\', get_bloginfo(\'template_url\').\'/js/jquery.flickrush.js\', array(\'jquery\'), \'1.0\');
wp_enqueue_script(\'audiojs\', get_bloginfo(\'template_url\').\'/js/audiojs/audio.js\', array(\'jquery\'), \'1.0\');
wp_enqueue_script(\'custom\', get_bloginfo(\'template_url\').\'/js/custom.js\', array(\'jquery\'), \'1.0\');
}
}
add_action(\'init\', \'my_script\');
在中
header.php
具体实施如下:
jQuery(\'ul.sf-menu\').superfish({
delay: <?php echo of_get_option(\'sf_delay\'); ?>, // one second delay on mouseout
animation: {
opacity:\'<?php echo of_get_option(\'sf_f_animation\'); ?>\',
height:\'<?php echo of_get_option(\'sf_sl_animation\'); ?>\'
}, // fade-in and slide-down animation
speed: \'<?php echo of_get_option(\'sf_speed\'); ?>\', // faster animation speed
autoArrows: <?php echo of_get_option(\'sf_arrows\'); ?>, // generation of arrow mark-up (for submenu)
dropShadows: <?php echo of_get_option(\'sf_shadows\'); ?> // drop shadows (for submenu)
});