2012-01-05 114 views
0

我是一个初学者... 我已经使用了两个jquery(一个是JQuery的弹出 - “颜色框的种类ajax”和另一个是Jquery的加载更多选项,获取数据 - 再次Ajax)它是与Mootools冲突/冲突(对于日历功能)。 这里是我的长途区号..不能解决jquery和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的)。 仍然代码不工作...任何帮助将非常明显... !!!! 感谢你

+0

我记得我使用'$ .jQuery()'而不是'$()'来定义选择器,但是在做这件事之前你应该做一件事情,我现在不记得了,互联网。我认为这是最好的方法,我用MooTools进行了测试,没有发生任何冲突。 – MahanGM 2012-01-05 13:47:27

+0

谢谢先生...但是,jquery是工作它的Mootools不工作.... 我试过你的建议,但同样的问题仍然Pan me我... – Akjethwani 2012-01-05 13:51:52

+0

在我以前的作品中找到它。首先,我做了一个'jQuery.noConflict();'接下来我使用'jQuery('')'作为选择器。试试这个,并报告我! – MahanGM 2012-01-05 14:04:29

回答

1

你正在修复你的实例,但是日历选取器插件使用document.id$?这个日历脚本有类似this.target = $(target);的东西 - 编辑它并修复到document.id或者像你的实例化那样放入一个闭包。

此外,您应该最后加载mootools及其依赖关系 - 如果$在其他地方定义,它会自v1.2.4开始自动恢复为document.id。你也可以在mootools forge上看看Arian的DatePicker,它是为mootools 1.3+编写的,而且是以不冲突的方式编写的。

+0

谢谢主席先生其实ima初学者...我不知道如何编辑主要编码事情就像你提到this.target = $(目标); ..到Document.id ...请帮助我也是.. 。? 此外,Calender即时通讯使用的是具有获取日期作为链接,将当前日期传递到处理数据的新页面根据传递的数据...我搜索了很多压光机为此,并在最后我发现这个日历...现在重新开始将会像地狱....请帮助我这个... 谢谢你... – Akjethwani 2012-01-05 14:43:35