datepicker和jstree或multipul之间的冲突
我在我的页面中使用datepicker
我使用jquery 1.6.2和jquery UI 1.8.14的datepicker
然后我使用适用于1.9.0或更高版本的jstree
和多选用至少1.7.0 jquery
我加载这些js文件
var jq162 = jQuery.noConflict(true);
现在我用这个
jq162(function() { //---------------------------------- jq162('#datepicker12from').datepicker({ onSelect: function(dateText, inst) { jq162('#datepicker12to').datepicker('option', 'minDate', new JalaliDate(inst['selectedYear'], inst['selectedMonth'], inst['selectedDay'])); } }); jq162('#datepicker12to').datepicker(); jq162('#datepicker').datepicker(); });
但也有这个代码datepicker不起作用
我能为这个问题做些什么?
如果可以,请帮助我,我真的需要解决这个程序
谢谢
这里最简单的解决方案是使用较新的jQuery库,因为DatePicker
仍然可以正常工作。
但…
根据您尝试使用的内容进行解决.noConflict()
:
HTML
<-- Leave the jsTree library out of here -->
jQuery(Javascript)
var jq162 = jQuery.noConflict(true); // For debugging. // You can see which version is loaded where. console.log(jq162.fn.jquery); console.log($.fn.jquery); jq162(function () { jq162('#datepicker12from').datepicker(); }); $(function () { // Load the jsTree script library here. $.getScript('js/jstree.min.js', function () { // When it's done loading, create your jsTree stuff. $('#jstree1').jstree(); }); });
演示