JQuery Colorbox $close.html(settings.close).show 不是函数错误
我已将 colorbox css 和 js 文件包含到我的应用程序中。我有一个这样的链接:
<a href="/changePassword.html" class="cboxElement" title="Change Password">Change Password</a>
我的js是这样的:
$(".cboxElement").colorbox();
但是我得到了这个错误:
$close.html(settings.close).show is not a function
[Break On This Error] $close.html(settings.close).show();
来自 colorbox 插件的方法的完整代码:
trigger(event_open, settings.onOpen);
$groupControls.add($title).hide();
$close.html(settings.close).show()// error happens here;
当我使用设置的 Firebug 元素调试它时是这样的:
h NaN
href "/pages/changePassword.html"
rel "nofollow"
title "Change Password"
w NaN
我使用 ColorBox v1.3.17.2
PS:我错过了什么,即给出宽度-高度吗?我想从可能的页面中的另一个页面加载内容。
I have included colorbox css and js files into my application. I have a link like that:
<a href="/changePassword.html" class="cboxElement" title="Change Password">Change Password</a>
and my js like that:
$(".cboxElement").colorbox();
However I get that error:
$close.html(settings.close).show is not a function
[Break On This Error] $close.html(settings.close).show();
Full code of method from colorbox plugin:
trigger(event_open, settings.onOpen);
$groupControls.add($title).hide();
$close.html(settings.close).show()// error happens here;
When I debug it with Firebug element of settings is like that:
h NaN
href "/pages/changePassword.html"
rel "nofollow"
title "Change Password"
w NaN
I use ColorBox v1.3.17.2
PS: Do I miss anything i.e. giving width - height? I want to load content from another page within may page.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请永远不要将
cboxElement
类放在事物上。 colorbox 在内部使用它来跟踪文档中的元素。当您遇到您所描述的错误时,通常是因为在需要使用iframe
时未使用iframe
。Please don't ever put the
cboxElement
class on things. That is used internally by colorbox to keep track of elements in your document. When you get errors like you are describing, it's usually from not using aniframe
when use of aniframe
would be required.我正在使用外部 colorbox 链接加载 HTML。当我在加载函数的回调中调用 colorbox 函数时,问题消失了。
I was loading HTML with a colorbox link externally. When I called the colorbox function at the callback of the load function, the problem disappeared.