I am using bootstrap into a WordPress theme and I have a conflict between jQuery in wp-include folder and my theme jQuery
this is my function jQuery that need bootstrap.min.js and jquery.js
jQuery(function($) {'use strict',
//#main-slider
$(function(){
$('#main-slider.carousel').carousel({
interval: 8000
});
});
});
how could I resolve this problem ?
Your code is messy and your redefining what the
$
symbol means.If you actually wish to redefine the jQuery
$
you can use the.noConflict
method.Make sure your selector is also correct
#main-slider.carousel
would select an element that looks like the following<div id="main-slider" class="carousel">
. The selector#main-slider
would achieve the same result.I suggest you include some HTML in your question. Failing that the code below is my best attempt to answer.
Try the following:
You have to put jQuery into no-conflict mode to use it along with other JS libraries. For example:
The easiest way for one script is: