【发布时间】:2012-02-03 08:06:25
【问题描述】:
我是初学者... 我使用了两个 Jquery(一个是用于弹出窗口的 Jquery-“Ajax 类型”来自 Color Box,另一个是 Jquery 用于加载更多选项以再次获取数据 Ajax)它与 Mootools 冲突/冲突(用于日历功能)。 这是我的呼叫代码..
<script type="text/javascript" src="cal/js/mootools-1.2.4-core.js"></script>
<script type="text/javascript" src="cal/js/mootools-1.2.4.4-more.js"></script>
<script type="text/javascript" src="cal/js/calendar-eightysix-v1.1.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script>
<script src="javascripts/popup-jquery/jquery.popup.googleapis.js"></script>
<script src="javascripts/popup-jquery/jquery.colorbox.js"></script>
<script type="text/javascript">
jQuery.noConflict();
// For jQuery scripts
(function($){
$(document).ready(function(){
//Calling Pop-up
$(".example5").colorbox();
//Calling More Button
$('.more').live("click",function()
{
var ID = $(this).attr("id");
if(ID)
{
$("#more"+ID).html('<img src="load/moreajax.gif" />');
$.ajax({
type: "POST",
url: "load/ajax_more_calender_content.php",
data: "lastmsg="+ ID,
cache: false,
success: function(html){
$("div#updates").append(html);
$("#more"+ID).remove();
}
});
}
else
{
$(".morebox").html('The End');
}
return false;
});
});
})(jQuery);
(function($) {
window.addEvent('domready', function() {
//Example XIII
var calendarXIII = new CalendarEightysix('exampleXIII', { 'injectInsideTarget': true, 'alwaysShow': true,'draggable': true, 'pickable': true });
calendarXIII.addEvent('rendermonth', function(e) {
//The event returns all the date related elements within the calendar which can easily be iterated
e.elements.each(function(day) {
day.set('title', day.retrieve('date').format('%A %d %B'));
day.setStyles({ 'cursor': 'pointer' }).addEvent('click', function() { window.location='../calender.php?date='+day.retrieve('date').get('date')+'&month='+day.retrieve('date').get('month')+'&year='+day.retrieve('date').get('year'); } );
});
});
calendarXIII.render(); //Render again because while initializing and doing the first render it did not have the event set yet
});
})(document.id);
</script>
我在许多论坛中阅读并以上述方式实现了它,工作代码只是弹出和加载更多选项(jQuery)而不是日历(mootools)。 并且代码仍然无法正常工作...任何帮助都将非常可观...!!!!! 谢谢你
【问题讨论】:
-
我记得我使用
$.jQuery()代替$()来定义选择器,但在此之前你应该做一件事,我现在不记得了,在网。我认为这是最好的方法,我用 MooTools 进行了测试,完全没有发生冲突。 -
谢谢您,先生...但是 jquery 正在运行,它的 Mootools 无法正常工作...。我尝试了您的建议,但同样的问题仍然让我感到恐慌...
-
在我之前的作品中找到的。首先我做了一个
jQuery.noConflict();,然后我使用jQuery('')作为选择器。试试这个并报告我! -
不,先生,它仍然无法正常工作... jQuery 插件已经在工作,这是 Mootools 插件无法正常工作... 我认为 Mootools 代码有问题...那是行不通的所以,我只保留了上面的代码并在 Firebug 的控制台中检查了它...它在 mootools-1.2.4-core.js 中显示错误并给出错误无法创建附加子项... !!!你对 Mootools 的工作机制有什么想法吗...如果你有请查看我的 Mootools 代码部分...
-
你有链接吗?或者一个 JS fiddle,以便我们可以帮助您正确调试?