I have a problem with Bootstrap.js 3. More precisely, my problem is with collapse.js for menu scrolling function and jquery library from WordPress 1.3.7.
I would like to use jquery from WP. When I enqueue bootstrap js, scrolling simply doesn’t work. If I delete WordPress jquery.js from wp-includes/js/jquery and add an older version of JQuery (i.e: v1.9.1) the scrolling function works great!
Is that possible that boostrap.js has some conflict with new jquery.js?
This is my code in functions.php
function my_scripts() {
wp_enqueue_script( 'jquery');
wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/assets/js/bootstrap.js', array('jquery'), true );
}
add_action( 'wp_enqueue_scripts', 'my_scripts' );
Thanks in advance
It is because of jQuery’s no conflict mode. You need to have following statement in between jQuery script inclusion and bootstrap script inclusion
or go to wp-includes/js/jquery and delete or comment last statement which is like