すべてが良さそうに見えますが、RequireJS でウェイポイントを使用できません。ここに私のコードがあります: http://jsfiddle.net/7nGzj/
main.js
requirejs.config({
"baseUrl": "theme/PereOlive/js/lib",
"paths": {
"app":"../app",
"jquery": "//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min"
},
"shim": {
"waypoints.min": ["jquery"]
}
});
requirejs(["app/common"]);
common.js
define([
'jquery',
"waypoints.min",
], function () {
$(function () {
console.log($.waypoints);
$('#loading').waypoint(function (direction) {
// do stuff
});
});
});
jQueryが適切にロードされていることを確認するためにそれをシムしましたが、機能しません。私の他のライブラリは、本来あるべきように機能します (responsiveslides、flexslider、hoverintent、smoothscroll など)。
- jQuery V1.10.2
- ウェイポイント V2.0.3
- RequireJS V2.1.8