jquery conflict

怎甘沉沦 提交于 2019-12-11 02:27:08

问题


In my project I am maintaining different jquery versions . so, I am getting jquery conflict please help me how to solve this problem.


回答1:


A simple Google search for jQuery conflict would have directed you to the API site:

http://api.jquery.com/jQuery.noConflict/

<script src='jquery-1.3.2.js'></script>
<script>
    var jq132 = jQuery.noConflict();
</script>

<script src='jquery-1.4.2.js'></script>
<script>
    var jq142 = jQuery.noConflict();
</script>



回答2:


try this

<script type="text/javascript">var jQuery_1_10_2 = $.noConflict(true);</script>

<script>jQuery_1_10_2(document).ready(function(){


jQuery_1_10_2("#click_id").click(function(){
 jQuery_1_10_2("#your_id").toggle();


 });});

</script>


来源:https://stackoverflow.com/questions/5645888/jquery-conflict

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!