admin管理员组文章数量:1387333
Sorry for not giving more details here, but has anyone experienced a javascript conflict between superfish.js and the WordPress plugin "contact form 7"?
Basically, I've gone through lots of debugging already and found a guaranteed conflict there, everything else on the site is great.
Should I initialize superfish.js somewhere else on my page since I can't control where the WordPress header initializes contact form 7?
EDIT: Forgot to mention the nature of the conflict - the superfish child ul's won't display when both scripts are active
Sorry for not giving more details here, but has anyone experienced a javascript conflict between superfish.js and the WordPress plugin "contact form 7"?
Basically, I've gone through lots of debugging already and found a guaranteed conflict there, everything else on the site is great.
Should I initialize superfish.js somewhere else on my page since I can't control where the WordPress header initializes contact form 7?
EDIT: Forgot to mention the nature of the conflict - the superfish child ul's won't display when both scripts are active
Share Improve this question asked Feb 10, 2011 at 23:47 BrianBrian 3,95912 gold badges58 silver badges104 bronze badges 2- What kind of conflict are you experiencing? – limc Commented Feb 10, 2011 at 23:49
- good question. Conflict is that superfish child ul's are hidden and don't appear on hover. – Brian Commented Feb 10, 2011 at 23:50
2 Answers
Reset to default 6Got it! jQuery multiple versions being loaded (the plugin was loading an outdated one). In order to de-register jQuery from Contact Form 7 (without editing core files), add the following to functions.php
// De-register jQuery from Contact Form 7
add_action( 'wp_print_scripts', 'my_deregister_javascript', 100 );
function my_deregister_javascript() {
wp_deregister_script( 'contact-form-7' );
}
With latest version of plugin you can add these lines to your functions.php to stop loading default css/js for the plugin on every page
add_filter( 'wpcf7_load_js', '__return_false' );
add_filter( 'wpcf7_load_css', '__return_false' );
more info here: http://contactform7./loading-javascript-and-stylesheet-only-when-it-is-necessary/
本文标签: jqueryjavascript conflict contact form 7 amp superfishjsStack Overflow
版权声明:本文标题:jquery - javascript conflict: contact form 7 & superfish.js - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744526022a2610749.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论