Comments (2)
BTW, if anyone else is having this same issue and going back to a previous version isn't an option and you don't want to modify the original code, you can get around this by directly setting the contents of the oncomplete property when invoking the slideshow.
var slideshow = $('.slideshow').slides(),
api = slideshow.data('slides');
api.opts.oncomplete = function(current) {
alert('the index number is: '+current);
}
api.opts.onupdate = function(current) {
alert('put your function actions here');
}
from jquery-slideshow.
@hyperlinked thanks for your detailed information. As soon as I started reading I thought "That's because it's a string" so thank you for saving me time checking that too ;-)
I can't think of a reasonable solution to this because functions should be passed by reference within JavaScript and any way of interpreting the string gleaned from the DOM into JS (eval
) is best avoided. The other option I can think of is to test if the given property is available within the global namespace, I.E.:
if (typeof this.opts.oncomplete === "string" && window[this.opts.oncomplete]) {
window[this.opts.oncomplete].call(...);
}
But I think that's somewhat unexpected behaviour. A test to see whether or not the option is callable is probably a sensible step to avoid errors and adding a precautionary note about usage too. However, I don't think adding functionality to interpret a string and best guess what the author meant is a good feature.
from jquery-slideshow.
Related Issues (20)
- Is there any way to make it circular HOT 1
- Slides change too rapidly, can't slow down HOT 6
- data-transition="?" HOT 1
- Deprecate homebrew swipe
- i use data-visible="4" , but it does't show 4 item ,i show all items HOT 1
- Possible to set showing time for eace slide?
- Removing the display of slide number in the pagination? HOT 4
- How to add pause button? HOT 1
- Update styles of custom navigation links to slides? HOT 2
- Add Custom CSS Transitions HOT 6
- Error with Internet Explorer HOT 6
- conflict with twitter bootstrap HOT 2
- Add timeout to touch events HOT 1
- Current Slide HOT 1
- nextText & previousText parameters HOT 1
- current slide for hash url HOT 1
- Scroll effect stop after it reach the end HOT 2
- Scrolling too far to the left when reaching the last image HOT 6
- Multiple slideshow HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-slideshow.