Using 2 Different Versions Of Jquery At The Same Time
When I use the following code to import 2 versions of jQuery, jquery.1.12.4 works but jquery.2.1.3 doesn't work.
Solution 1:
can you try the following way it should work if you define 'noConflict()
for both versions
jQuery(document).ready(function() {
$jquery_2_1(function(jQuery) {
varAccordion = function(el, multiple) {
this.el = el || {};
this.multiple = multiple || false;
// Variables privadasvar links = this.el.find('.link');
// Evento
links.on('click', {
el: this.el,
multiple: this.multiple
}, this.dropdown)
}
Accordion.prototype.dropdown = function(e) {
var $el = e.data.el;
$this = $(this),
$next = $this.next();
$next.slideToggle();
$this.parent().toggleClass('open');
if (!e.data.multiple) {
$el.find('.submenu').not($next).slideUp().parent().removeClass('open');
};
}
var accordion = newAccordion(jQuery('#accordion'), false);
});
});
<scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><scripttype="text/javascript">
$jquery_2_1 = jQuery.noConflict();
</script><scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script><scripttype="text/javascript">
$jquery_1_12 = jQuery.noConflict();
</script>
Post a Comment for "Using 2 Different Versions Of Jquery At The Same Time"