JS-Conflict with mobile menu
-
Hello all,
after installing the Pro-Version of the jquery audio player my mobile responsive menu theme does not work. Maybe because of a jquery-conflict? When I turn off the plugin the menu is working fine. I’am using Baylys WordPress Theme (http://www.elmastudio.de/wordpress-themes/baylys/). There is not much JS in it. I don’t know where the conflicts are, I’m not a coding guy. Is there any possiblitiy to check the code in an error-logfile with firebug or something like that?
You can check the error on http://www.guete.de. Just turn the side down to 1024px to see the responsive mobile menu icon up in the right corner.
Screenshot: http://postimage.org/image/iydzleyrp/http://wordpress.org/extend/plugins/html5-jquery-audio-player/
-
I have now used firebug for debugging the conflict between my theme and the plugin. It says:
TypeError: jQuery(...).smoothScroll is not a function jQuery('a.top').smoothScroll();
jQuery(document).ready(function() { jQuery('a.top').smoothScroll(); jQuery('a.share-btn').click(function() { jQuery.smoothScroll({ scrollElement: jQuery('.share'), scrollTarget: '#' }); return false; });
Have you got any suggestions? It’s the Audio-Plugin that causes the error, I think. Maybe there is a wordaround for it?
check and see if you already have jquery loaded. I had the same type error/conflict when I installed this plugin so I commented out the author’s include statement for his jquery-1.7 file in the plugins directory, in the file ‘html5-jquery-audio-player/index.php’.
Just search for jquery and yu should find the line im talking about.See point 5 in the FAQs please
@devincox: There is no index.php. With ‘html5-jquery-audio-player/index.php’ you mean the “plugin.php”, right?
Where should I commented out the code?function pro_scripts_method() { wp_deregister_script( 'hmp-jquery' ); wp_register_script( 'hmp-jquery', "http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"); wp_enqueue_script( 'hmp-jquery' ); wp_deregister_script( 'drag-jquery' ); wp_register_script( 'drag-jquery', plugin_dir_url( __FILE__ )."/player/js/jquery-ui-1.7.1.custom.min.js"); wp_enqueue_script( 'drag-jquery' ); wp_register_style( 'hmp-style', plugin_dir_url( __FILE__ )."/includes/css/hmp-style.css"); wp_enqueue_style( 'hmp-style' ); }
@enigmaweb: I read the article by Chris Coyier and looked the code in the themes header,php. It’s already there:
<?php wp_enqueue_script('jquery'); if ( is_singular() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); wp_head(); ?>
- The topic ‘JS-Conflict with mobile menu’ is closed to new replies.