I'm curious to know why I'm getting this error? I've copied it exact from the website beezid.com (carousel.js
) file, and I'm trying to get the same slide as them onto my website to update it.. As you can see I'm having issues with this?? Their site doesn't come up with this error?
carousel.js:26 Uncaught ReferenceError: Class is not defined
Carousel = Class.create(Abstract, {
initialize: function (scroller, slides, controls, options) {
this.scrolling = false;
this.scroller = $(scroller);
this.slides = slides;
this.controls = controls;
this.menu = false;
this.menuTitleLen = 20;
Class
is not a JavaScript type, so you can't use it. That web site is probably using some third party library that provides a Class
type to simplify some types creation etc.
From a quick inspection of the source code it is apparent that this site uses:
I think Prototype has a Class type. Here is a link to Prototype's tutorial on javascript "classes" and inheritance: http://prototypejs.org/learn/class-inheritance
add
<script src="https://ajax.googleapis.com/ajax/libs/prototype/1.7.2.0/prototype.js"></script>
You could use Prototype(http://prototypejs.org/) which is a library. Then the issue is resolved.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With