Elastislide
Elastislide copied to clipboard
Issue with SetCurrent, undefined is not a function
I have a Elastislide setup on my site with 10-15 thumbnails. The slider works great, everything is right where I want it, but I cannot get a function to work.
Here is what I am trying to do:
spThumbSlider = $('#carousel').show().elastislide({
orientation : 'vertical',
minItems : 5,
onClick : function( $item ) {
spThumbSlider.setCurrent($item.index());
}
});
Whenever I do that, I receive a console error that undefined is not a function. I've tried a few of the other functions, same issue.
I have other images on the page that call a click on the carousel thumbnail when hovered. That part works great. The script finds the image in the thumbnails, sets it to active, and "clicks" it. I just need the slider to slide to the image.
What am I doing wrong?
Nevermind, the min.js version worked perfectly.
I have the same issue. Could you please tell me how to fix it?
Mine is working fine like this:
spThumbSlider = $('#carousel').show().elastislide({ orientation : 'vertical', minItems : 5, });
I then call setCurrent using:
spThumbSlider.setCurrent(i);
I’ve had no issues with it.
From: MikeSha [mailto:[email protected]] Sent: Wednesday, May 20, 2015 9:59 AM To: codrops/Elastislide Cc: Brandon Dowd Subject: Re: [Elastislide] Issue with SetCurrent, undefined is not a function (#38)
I have the same issue. How to fix it?
— Reply to this email directly or view it on GitHubhttps://github.com/codrops/Elastislide/issues/38#issuecomment-103896928.
Thanks, but it doen't work for me :(
Now that I think about it, I may have modified the .js file to get it to work.
Not sure how I can send you mine to test though.
From: MikeSha [mailto:[email protected]] Sent: Wednesday, May 20, 2015 10:18 AM To: codrops/Elastislide Cc: Brandon Dowd Subject: Re: [Elastislide] Issue with SetCurrent, undefined is not a function (#38)
Thanks, but it doen't work for me :(
— Reply to this email directly or view it on GitHubhttps://github.com/codrops/Elastislide/issues/38#issuecomment-103902965.
Thank you. I'll try
This seems to be a problem with JQuery's each function, I had this issue using jquery version 1.10.x. I decided to use another approach so I am not continuing with this library so I didn't dig further.
Not recommended but a quick hack is if you have only a single Elastislide on your page, you could remove the $.each() and directly call the inner callback within the plugin constructor: $.fn.elastislide(...)
Hopefully a Elastislide contributor will fix this properly.