未捕获的TypeError: Object [Object Object]没有方法'overlay'
Uncaught TypeError: Object [object Object] has no method 'overlay'
为什么我得到这个错误从我的覆盖jquery代码?
这是代码:
jQuery(document).ready(function($) {
// if the function argument is given to overlay,
// it is assumed to be the onBeforeLoad event listener
$("a[rel]").overlay({
mask: 'darkred',
effect: 'apple',
onBeforeLoad: function() {
// grab wrapper element inside content
var wrap = this.getOverlay().find(".contentWrap");
// load the page specified in the trigger
wrap.load(this.getTrigger().attr("href"));
}
});
});
这段代码是这样叠加的:http://flowplayer.org/tools/demos/overlay/external.html
想买吗?
p。对不起,我的英语不好。
"Could not find Overlay: nofollow"是由于使用非特定的css选择器来查找你想要附加叠加的链接而导致的。
正确地包含javascript是最初问题的正确答案…我来到这个页面基于覆盖:nofollow问题的评论....因为这是我发现的第一件事,没有找到答案,我想在这里发表评论,因为我发现这是由css选择器找到其他用途造成的…并且没有nofollow覆盖…
假设'overlay'是div的id,如下所示:
<!-- overlayed element -->
<div class="apple_overlay" id="overlay">
< !-- the external content is loaded inside this tag -- >
<div class="contentWrap"></div>
</div>
你应该这样做:
$("a[rel=#overlay]").overlay(
代替:
$("a[rel]").overlay(
你需要在jQuery将其视为对象的一部分之前加载overlay
插件;看到下面。
注意:插件必须在jQuery脚本
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script src="http://cdn.jquerytools.org/1.2.6/all/jquery.tools.min.js"></script>
遇到了同样的问题,发现了一个非常奇怪的解决方案。我只是包含了jquery。tools before jquery。这样的UI:
<script src='js/jquery-1.4.2.min.js' type='text/javascript'></script>
<script src='js/jquery.tools.min.js' type='text/javascript'></script>
<script src='js/jquery-ui-1.7.2.custom.min.js' type='text/javascript'></script>
。不知道为什么它现在有效,但它确实有效。
您是否在页面中包含了覆盖脚本src ?
相关文章:
- 函数未在Object.keys或Object.getOwnPropertyNames下列出,但可以调用
- delete在Object上效率低下,但在DOM Element's的数据属性,与null out相比
- 有没有一种方法可以列出Ember.Object的所有绑定
- 如何取消object.prototypes javascript的一个函数
- 为什么是文档.旧版应用程序中的DOM-object.properties为null
- 将*.js文件的内容放入Object中
- Object.prototype using 'this'
- 使用Object.create()的角度服务继承
- 如何使用object.assign()从其他对象引用基本对象属性
- 循环的数组推入在Object容器中具有不同的值
- reducers在redux中得到Function not Object,what'it’他错了
- JSON.stringify和Object.keys在同一个对象上产生不同的结果
- 在使用object.create创建的对象中使用super
- Join架构验证:Join.object定义数组中的有效键
- jquery打印[object XMLDocument]而不是文件内容
- ExtJS 4 Object.prototype fail
- JavaScript-从对象数组中输出随机OBJECT
- 为什么“{}+1”在Chrome和Firefox中排名第一,而字符串'[object object]1'
- 什么是“;原型;通过JavaScript中的Object Literal Notation创建的对象的链接
- 未捕获的TypeError: Object [Object Object]没有方法'overlay'