diff --git a/examples/js-navigation/img/example-slide-1.jpg b/examples/js-navigation/img/example-slide-1.jpg new file mode 100644 index 0000000..1d6fa22 Binary files /dev/null and b/examples/js-navigation/img/example-slide-1.jpg differ diff --git a/examples/js-navigation/img/example-slide-2.jpg b/examples/js-navigation/img/example-slide-2.jpg new file mode 100644 index 0000000..9d8d054 Binary files /dev/null and b/examples/js-navigation/img/example-slide-2.jpg differ diff --git a/examples/js-navigation/img/example-slide-3.jpg b/examples/js-navigation/img/example-slide-3.jpg new file mode 100644 index 0000000..89f8912 Binary files /dev/null and b/examples/js-navigation/img/example-slide-3.jpg differ diff --git a/examples/js-navigation/img/example-slide-4.jpg b/examples/js-navigation/img/example-slide-4.jpg new file mode 100644 index 0000000..b0648a2 Binary files /dev/null and b/examples/js-navigation/img/example-slide-4.jpg differ diff --git a/examples/js-navigation/index.html b/examples/js-navigation/index.html new file mode 100644 index 0000000..4ced815 --- /dev/null +++ b/examples/js-navigation/index.html @@ -0,0 +1,110 @@ + + + + + SlidesJS Basic Code Example + + + + + + + + + + + + + + + +
+
+ Photo by: Missy S Link: http://www.flickr.com/photos/listenmissy/5087404401/ + Photo by: Daniel Parks Link: http://www.flickr.com/photos/parksdh/5227623068/ + Photo by: Mike Ranweiler Link: http://www.flickr.com/photos/27874907@N04/4833059991/ + Photo by: Stuart SeegerLink: http://www.flickr.com/photos/stuseeger/97577796/ +
+
+ + + + + + + + + + + + + + + + + + + + diff --git a/examples/js-navigation/js/jquery.slides.js b/examples/js-navigation/js/jquery.slides.js new file mode 100644 index 0000000..765f2e8 --- /dev/null +++ b/examples/js-navigation/js/jquery.slides.js @@ -0,0 +1,609 @@ +// Generated by CoffeeScript 1.6.3 +(function() { + (function($, window, document) { + var Plugin, defaults, pluginName; + pluginName = "slidesjs"; + defaults = { + width: 940, + height: 528, + start: 1, + navigation: { + active: true, + effect: "slide" + }, + pagination: { + active: true, + effect: "slide" + }, + play: { + active: false, + effect: "slide", + interval: 5000, + auto: false, + swap: true, + pauseOnHover: false, + restartDelay: 2500 + }, + effect: { + slide: { + speed: 500 + }, + fade: { + speed: 300, + crossfade: true + } + }, + callback: { + loaded: function() {}, + start: function() {}, + complete: function() {} + }, + commands: null + }; + Plugin = (function() { + function Plugin(element, options) { + this.element = element; + this.options = $.extend(true, {}, defaults, options); + this._defaults = defaults; + this._name = pluginName; + this.init(); + } + + return Plugin; + + })(); + Plugin.prototype.init = function() { + var $element, nextButton, pagination, playButton, prevButton, stopButton, + _this = this; + $element = $(this.element); + this.data = $.data(this); + $.data(this, "animating", false); + $.data(this, "total", $element.children().not(".slidesjs-navigation", $element).length); + $.data(this, "current", this.options.start - 1); + $.data(this, "vendorPrefix", this._getVendorPrefix()); + if (typeof TouchEvent !== "undefined") { + $.data(this, "touch", true); + this.options.effect.slide.speed = this.options.effect.slide.speed / 2; + } + $element.css({ + overflow: "hidden" + }); + $element.slidesContainer = $element.children().not(".slidesjs-navigation", $element).wrapAll("
", $element).parent().css({ + overflow: "hidden", + position: "relative" + }); + $(".slidesjs-container", $element).wrapInner("
", $element).children(); + $(".slidesjs-control", $element).css({ + position: "relative", + left: 0 + }); + $(".slidesjs-control", $element).children().addClass("slidesjs-slide").css({ + position: "absolute", + top: 0, + left: 0, + width: "100%", + zIndex: 0, + display: "none", + webkitBackfaceVisibility: "hidden" + }); + $.each($(".slidesjs-control", $element).children(), function(i) { + var $slide; + $slide = $(this); + return $slide.attr("slidesjs-index", i); + }); + if (this.data.touch) { + $(".slidesjs-control", $element).on("touchstart", function(e) { + return _this._touchstart(e); + }); + $(".slidesjs-control", $element).on("touchmove", function(e) { + return _this._touchmove(e); + }); + $(".slidesjs-control", $element).on("touchend", function(e) { + return _this._touchend(e); + }); + } + $element.fadeIn(0); + this.update(); + if (this.data.touch) { + this._setuptouch(); + } + $(".slidesjs-control", $element).children(":eq(" + this.data.current + ")").eq(0).fadeIn(0, function() { + return $(this).css({ + zIndex: 10 + }); + }); + if (this.options.navigation.active) { + prevButton = $("", { + "class": "slidesjs-previous slidesjs-navigation", + href: "#", + title: "Previous", + text: "Previous" + }).appendTo($element); + nextButton = $("", { + "class": "slidesjs-next slidesjs-navigation", + href: "#", + title: "Next", + text: "Next" + }).appendTo($element); + } + $(".slidesjs-next", $element).click(function(e) { + e.preventDefault(); + _this.stop(true); + return _this.next(_this.options.navigation.effect); + }); + $(".slidesjs-previous", $element).click(function(e) { + e.preventDefault(); + _this.stop(true); + return _this.previous(_this.options.navigation.effect); + }); + if (this.options.play.active) { + playButton = $("", { + "class": "slidesjs-play slidesjs-navigation", + href: "#", + title: "Play", + text: "Play" + }).appendTo($element); + stopButton = $("", { + "class": "slidesjs-stop slidesjs-navigation", + href: "#", + title: "Stop", + text: "Stop" + }).appendTo($element); + playButton.click(function(e) { + e.preventDefault(); + return _this.play(true); + }); + stopButton.click(function(e) { + e.preventDefault(); + return _this.stop(true); + }); + if (this.options.play.swap) { + stopButton.css({ + display: "none" + }); + } + } + if (this.options.pagination.active) { + pagination = $("