Why does including prototype.js break the functioning of jquery bbq?

痴心易碎 提交于 2019-12-02 07:02:33

By including prototype.js after jQuery, Prototype will override the value of the global $ variable. You just need to use:

var $j = jQuery.noConflict();

You can then use $j in place of $ in jQuery contexts and $ for prototype contexts. Here's the documentation: http://api.jquery.com/jQuery.noConflict/.

jQuery and Prototype both use the $ character so they will conflict.

If you wish to use them both together you will need to make use of jQuery's noConflict() method to release the $ alias back to Protoype

There is also a scrollTo jQuery plugin

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