Closed itajackass closed 4 years ago
Hi, so I think the issue here is that bootstrap also extends the jQuery object with a method called collapse. eg $.collapse()
.
So from the code that you pasted in your example:
// Expose in jQuery API
$.fn.extend({
// This conflicts with Bootstrap <-----------
collapse: function(options, scan) {
var nodes = (scan) ? $("body").find("[data-collapse]") : $(this);
return nodes.each(function() {
var settings = (scan) ? {} : options,
values = $(this).attr("data-collapse") || "";
$.each(values.split(" "), function(i,v) {
if(v) settings[v] = true;
});
new Collapse($(this), settings);
});
}
});
...
//jQuery DOM Ready
$(function() {
// This conflicts with Bootsrap <-----------
$.fn.collapse(false, true);
});
If you rename collapse
to jQueryCollapse
it might work in this instance, and it won't conflict with Bootstrap anymore.
Thank you. It works now. Do you update your code? thanks
Yeah, I might update the code to do a check if collapse
is already defined by another plugin it should throw a warning and use jqueryCollapse
instead. That way I will keep backwards compatibility.
Hi, If I insert jquery-collapse in the same page where I have plugin: boostrap-datetimepicker I can't change HOUR
See demo: https://jsfiddle.net/0t4mgLak/