无法访问 Jquery JCrop api
我正在尝试访问 jCrop api ( http://deepliquid.com )。
这是我的代码片段:
// The selected image has been loaded
$('#selectedImage').load(function() {
var jcrop_api = $('#selectedImage').Jcrop({
touchSupport: true,
onSelect: cropSelected
});
jcrop_api.setSelect([ 100,100,200,200 ]);
});
我进入控制台: 类型错误:表达式“jcrop_api.setSelect”[未定义] 的结果不是函数。
我知道我可以传递一些参数作为选项,但我想使用 api 来执行一些其他操作(setImage 等)。
有什么想法吗? 多谢 !
I am trying to access to the jCrop api ( http://deepliquid.com ).
Here is my code snippet :
// The selected image has been loaded
$('#selectedImage').load(function() {
var jcrop_api = $('#selectedImage').Jcrop({
touchSupport: true,
onSelect: cropSelected
});
jcrop_api.setSelect([ 100,100,200,200 ]);
});
I get in the console :
TypeError: Result of expression 'jcrop_api.setSelect' [undefined] is not a function.
I am aware that I can pass some parameters as options, but I would like to use the api to perform some other stuff (setImage, etc.)
Any ideas ?
Thanks a lot !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您以错误的方式调用 api...
将其更改
为:
You are calling the api in the wrong way...
change this:
to this: