Ein wenig Anpassung und es geht.
Aufruf in der index.html:
Anpassungen in der JS Datei:Code:$(function () { $('.anythingSlider').anythingSlider({ easing: "easeInOutExpo", // Anything other than "linear" or "swing" requires the easing plugin autoPlay: true, // This turns off the entire FUNCTIONALY, not just if it starts running or not. delay: 3000, // How long between slide transitions in AutoPlay mode startStopped: false, // If autoPlay is on, this can force it to start stopped animationTime: 600, // How long the slide transition takes hashTags: true, // Should links change the hashtag in the URL? buildNavigation: true, // If true, builds and list of anchor links to link to each slide pauseOnHover: true, // If true, and autoPlay is enabled, the show will pause on hover startText: "Go", // Start text stopText: "Stop", // Stop text navigationFormatter: formatText, // Details at the top of the file on this use (advanced use) loop: false }); $("#slide-jump").click(function(){ $('.anythingSlider').anythingSlider(6); }); });
a) die function gotoPage() anpassen:
b) die defaults anpassen:Code:base.gotoPage = function(page, autoplay) { // When autoplay isn't passed, we stop the timer if (autoplay !== true) autoplay = false; if (!autoplay) base.startStop(false); if (typeof(page) == "undefined" || page == null) { page = 1; base.setCurrentPage(1); }; // Just check for bounds if (page > base.pages + 1) page = base.pages; if (page < 0 ) page = 1; var dir = page < base.currentPage ? -1 : 1, n = Math.abs(base.currentPage - page), left = base.singleWidth * dir * n; base.$wrapper.filter(':not(:animated)').animate({ scrollLeft : '+=' + left }, base.options.animationTime, base.options.easing, function () { if (page == 0) { base.$wrapper.scrollLeft(base.singleWidth * base.pages); page = base.pages; } else if (page > base.pages) { base.$wrapper.scrollLeft(base.singleWidth); // reset back to start position page = 1; } else if (page == base.pages && base.options.loop == false){ base.startStop(!base.playing); }; base.setCurrentPage(page); }); };
Die Änderungen sind gefettet und rot!Code:$.anythingSlider.defaults = { easing: "swing", // Anything other than "linear" or "swing" requires the easing plugin autoPlay: true, // This turns off the entire FUNCTIONALY, not just if it starts running or not startStopped: false, // If autoPlay is on, this can force it to start stopped delay: 3000, // How long between slide transitions in AutoPlay mode animationTime: 600, // How long the slide transition takes hashTags: true, // Should links change the hashtag in the URL? buildNavigation: true, // If true, builds and list of anchor links to link to each slide pauseOnHover: true, // If true, and autoPlay is enabled, the show will pause on hover startText: "Start", // Start text stopText: "Stop", // Stop text navigationFormatter: null, // Details at the top of the file on this use (advanced use) forwardText: ">", // Link text used to move the slider forward backText: "<", // Link text used to move the slider back loop: true };
Nun kannst du mit dem Parameter 'loop' steuern, ob es ein Loop sein soll oder nicht, lässt du den Parameter weg, wird der default genutzt, welcher 'true' ist, also dann läuft es als Loop durch.


LinkBack URL
About LinkBacks
Zitieren