[英]“Uncaught TypeError: undefined is not a function” JavaScript error using noobslider and mootools
I'm new to Javascript and have been attempting to use a Slider called noobSlide (mootools) but, after one success with it, have found it broken on my second attempt. 我是Java的新手,并且一直在尝试使用名为noobSlide(mootools)的Slider,但是在成功使用它之后,发现它在我的第二次尝试中失败了。
The error that I'm getting reads "Uncaught TypeError: undefined is not a function" in reference to this line of code: 引用此行代码,我收到的错误为“ Uncaught TypeError:undefined is a function”:
var thumbsFx = new Fx.Style(thumbs_mask7,'left',fxOptions7);
I've included all of the necessary libraries for Mootools and the Slider scripts in the head of my pages, and have combed the HTML, but can't find a solution. 我已经在页面的顶部包含了Mootools和Slider脚本的所有必需库,并且已经整理了HTML,但是找不到解决方案。 It seems to be pointing me to the Mootools library but I know that isn't right since, as I said, I've already succeeded with it once using another example.
似乎将我指向Mootools库,但是我知道那是不对的,因为正如我所说,我已经使用另一个示例成功完成了它。
If it helps, here is the page housing all of the samples of the Slider (I'm trying to use #7 and have already used #3). 如果有帮助,则此页面包含Slider的所有示例(我正在尝试使用#7,并且已经使用#3)。
http://www.efectorelativo.net/laboratory/noobSlide/ http://www.efectorelativo.net/laboratory/noobSlide/
If anyone can see where the source of the problem may be, I would really appreciate your eyes :) 如果有人能看到问题的根源,我将不胜感激:)
Thanks, 谢谢,
Juliana 朱莉安娜
<script type="text/javascript">
window.addEvent('domready',function(){
//SAMPLE 7
var startItem = 0; //or 0 or any
var thumbs_mask7 = $('thumbs_mask7').setStyle('left',(startItem*60-568)+'px').setOpacity(0.8);
var fxOptions7 = {duration:1000, transition:Fx.Transitions.Back.easeOut, wait:false};
var thumbsFx = new Fx.Style(thumbs_mask7,'left',fxOptions7);
var hs7 = new noobSlide({
box: $('box7'),
items: [0,1,2,3,4,5,6,7],
handles: $ES('span','thumbs_handles7'),
fxOptions: fxOptions7,
onWalk: function(currentItem){
thumbsFx.start(currentItem*60-568);
},
startItem: startItem
});
hs7.walk(0);
});
</script>
why you don't use 为什么你不使用
$ES('span','thumbs_handles7')
as in their example? 如他们的例子?
$$('#thumbs_handles7 span')
Is this fixing the error? 这是在解决错误吗?
Note: You need to make sure that you have all the html tags and their related ids as you defined them in the javascript code 注意:您需要确保在javascript代码中定义了所有html标记及其相关ID后,
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.