Permalink
Browse files

updated app html, removed static site from demo folder, we shouldnt h…

…ave two copies of it.
  • Loading branch information...
1 parent 5db8576 commit d0aeb0620347d9688aca78890191ff307f5e2991 @Johnrae Johnrae committed May 31, 2016
Showing with 87 additions and 4,432 deletions.
  1. BIN app/Turntable.zip
  2. BIN app/TurntableSlider.zip
  3. +10 −8 app/index.html
  4. +1 −1 app/js/main.js.map
  5. +9 −2 js/main.js
  6. BIN turntable/Turntable.zip
  7. 0 turntable/{TurntableSlider → Turntable}/css/turntable.css
  8. 0 turntable/{TurntableSlider → Turntable}/css/turntable.min.css
  9. +59 −25 turntable/{TurntableSlider → Turntable}/js/turntable.js
  10. +8 −0 turntable/Turntable/js/turntable.min.js
  11. +0 −8 turntable/TurntableSlider/js/turntable.min.js
  12. BIN turntable/demo/TurntableSlider.zip
  13. +0 −3,340 turntable/demo/css/animate.css
  14. +0 −6 turntable/demo/css/bootstrap.min.css
  15. +0 −380 turntable/demo/css/main.css
  16. +0 −424 turntable/demo/css/normalize.css
  17. BIN turntable/demo/images/plant1.JPG
  18. BIN turntable/demo/images/plant10.JPG
  19. BIN turntable/demo/images/plant11.JPG
  20. BIN turntable/demo/images/plant12.JPG
  21. BIN turntable/demo/images/plant13.JPG
  22. BIN turntable/demo/images/plant14.JPG
  23. BIN turntable/demo/images/plant15.JPG
  24. BIN turntable/demo/images/plant16.JPG
  25. BIN turntable/demo/images/plant17.JPG
  26. BIN turntable/demo/images/plant18.JPG
  27. BIN turntable/demo/images/plant19.JPG
  28. BIN turntable/demo/images/plant2.JPG
  29. BIN turntable/demo/images/plant20.JPG
  30. BIN turntable/demo/images/plant21.JPG
  31. BIN turntable/demo/images/plant22.JPG
  32. BIN turntable/demo/images/plant23.JPG
  33. BIN turntable/demo/images/plant24.JPG
  34. BIN turntable/demo/images/plant25.JPG
  35. BIN turntable/demo/images/plant26.JPG
  36. BIN turntable/demo/images/plant27.JPG
  37. BIN turntable/demo/images/plant28.JPG
  38. BIN turntable/demo/images/plant3.JPG
  39. BIN turntable/demo/images/plant4.JPG
  40. BIN turntable/demo/images/plant5.JPG
  41. BIN turntable/demo/images/plant6.JPG
  42. BIN turntable/demo/images/plant7.JPG
  43. BIN turntable/demo/images/plant8.JPG
  44. BIN turntable/demo/images/plant9.JPG
  45. +0 −216 turntable/demo/index.html
  46. +0 −7 turntable/demo/js/bootstrap.min.js
  47. +0 −15 turntable/demo/js/main.js
View
Binary file not shown.
Binary file not shown.
View
@@ -40,7 +40,7 @@
<li>
<a href="#install">Install</a>
</li>
- <a href="https://s3.amazonaws.com/turntable-slider/TurntableSlider.zip" class="btn btn-white-outline navbar-btn">Download</a>
+ <a href="https://s3.amazonaws.com/turntable-slider/Turntable.zip" class="btn btn-white-outline navbar-btn">Download</a>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
@@ -49,7 +49,6 @@
<header class="position-9">
<div class="container">
-
<div class="turntable-container">
<div class="header-overlay turntable" id="turntable">
<ul>
@@ -75,6 +74,7 @@
<h1 class="text-color">Turntable.js</h1>
<p class="text-color lead">A Responsive JQuery Slider</p>
</div>
+
</div>
</header>
@@ -200,16 +200,18 @@ <h2 id="install">Installation</h2>
</div>
<h2 id="settings">Settings</h2>
- <p class="lead">Turntable.js will accept an object as a parameter. You can decide if you want to flip through the images as your mouse moves along the X or Y axis of the container. You can pass in the object when you call the plugin like this.</p>
+ <p class="lead">Turntable.js will accept an object as a parameter. There are three keys you can use to customize the slider. You can decide if you want to flip through the images as your mouse moves along the X or Y axis of the container, or as you scroll down the page using <b>axis</b>. If you want to reverse the direction it goes through the images, pass in <b>reverse: true</b>. You can also decide where the container will start to turn while you scroll down the page. Try playing around with the different options until you find what works best for you. You can pass in the object when you call the plugin like this -</p>
<pre class="prettyprint pad language-java">
-$('#mySpinnyContainer').turntable(
- {axis: 'y'}
-);
+$('#mySpinnyContainer').turntable({
+ axis: 'x, y, or scroll',
+ reverse: boolean, // true or false, will reverse the array of images
+ scrollStart: 'top, middle, or bottom', // only necessary if axis = 'scroll'
+});
</pre>
<p class="lead">The plugin will default to the X axis if no option is provided.</p>
<br>
- <p>v 1.0</p>
+ <p>v 1.1</p>
</div>
</section>
@@ -235,7 +237,7 @@ <h2 id="settings">Settings</h2>
<script type="text/javascript" src="./js/main.js"></script>
<script type="text/javascript">
$('#turntable').turntable({axis: 'x', reverse: true});
- $('#turntable2').turntable({axis: 'scroll'})
+ $('#turntable2').turntable({axis: 'scroll'});
</script>
</body>
View
Oops, something went wrong.
View
@@ -1,3 +1,10 @@
+/*
+ * TurntableSlider
+ * v 1.1.1
+ *
+ * Copyright (c) 2016 Polar Notion
+ * Licensed under the MIT license.
+ */
(function($){
@@ -13,9 +20,9 @@
};
var $listItems = $('ul', this).children(),
- settings = $.extend({}, $.fn.turntable.defaults, options),
+ settings = $.extend({}, $.fn.turntable.defaults, options),
$turntable = $(this),
- sections = [];
+ sections = [];
// splits container based on
// amount of li's in turntable
Binary file not shown.
@@ -1,10 +1,11 @@
/*
* TurntableSlider
- * v 1.0.1
+ * v 1.1.1
*
* Copyright (c) 2016 Polar Notion
* Licensed under the MIT license.
*/
+
(function($){
$.fn.turntable = function(options){
@@ -14,9 +15,9 @@
var mobilecheck = function() {
var check = false;
- (function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))check = true})(navigator.userAgent||navigator.vendor||window.opera);
+ (function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))check = true;})(navigator.userAgent||navigator.vendor||window.opera);
return check;
- }
+ };
var $listItems = $('ul', this).children(),
settings = $.extend({}, $.fn.turntable.defaults, options),
@@ -27,10 +28,11 @@
// amount of li's in turntable
function divideContainer(images) {
- var initialLength = undefined,
+ var initialLength,
dividend = images.length;
-
- if (settings.axis === 'y') {
+ if (settings.axis === 'scroll') {
+ initialLength = $(window).height();
+ } else if (settings.axis === 'y') {
initialLength = $turntable.height();
} else {
initialLength = $turntable.width();
@@ -39,19 +41,29 @@
var sectionLength = initialLength / dividend;
// creates array of value pairs with min and max ranges
- for (var j = 0; j < images.length; j++) {
- sections[j] = {
- min: sectionLength * j,
- max: sectionLength + (sectionLength * j),
- index: j
+ for (var i = 0; i < images.length; i++) {
+ sections[i] = {
+ min: sectionLength * i,
+ max: sectionLength + (sectionLength * i),
+ index: i
};
}
+
+ // reverses direction
+ if (settings.reverse === true) {
+ // reverse array
+ sections.reverse();
+ // reset index values
+ $.each(sections, function(i, obj) {
+ obj.index = i;
+ });
+ }
}
//loads images one at a time on page load
(function appendImages(callback) {
$listItems.each(function () {
- $(this).append('<img src="' + $(this).data("imgSrc") + '">');
+ $(this).html('<img src="' + $(this).data("imgSrc") + '">');
});
})();
@@ -69,16 +81,34 @@
// loop through array and find correct range pair
var applyClasses = function(sections, position) {
$.each(sections, function () {
- if (position >= this.min && position <= this.max) {
- $listItems.removeClass('active');
- $listItems.eq(this.index).addClass("active");
- }
- });
- };
+ if (position >= this.min && position <= this.max) {
+ $listItems.removeClass('active');
+ $listItems.eq(this.index).addClass("active");
+ }
+ });
+ };
// finds mouse position and appends body
// based on location
- if(mobilecheck()){
+ if (settings.axis === 'scroll'){
+ // scroll
+ return $(window).scroll(function(){
+ var scrollStart;
+ if (settings.scrollStart === 'bottom') {
+ scrollStart = $turntable.height();
+ } else if (settings.scrollStart === 'top') {
+ scrollStart = 0;
+ } else {
+ // scroll start is middle or other unusable value
+ scrollStart = $turntable.height() / 2;
+ }
+ var offset = $turntable.offset();
+ var position = offset.top - ( $(window).scrollTop() - scrollStart );
+ applyClasses(sections, position);
+ });
+
+ } else if(mobilecheck()){
+ // touch
return $turntable.on("touchmove", function (e) {
e.preventDefault();
var offset = $(this).offset();
@@ -92,7 +122,9 @@
// loop through array and find correct range pair
applyClasses(sections, position);
});
+
} else {
+ // mouseover
return $turntable.on("mousemove", function (e) {
var offset = $(this).offset();
var position;
@@ -102,13 +134,15 @@
position = e.pageX - offset.left;
}
applyClasses(sections, position);
-
- });
+ });
+
}
- }
+ }; //end if
$.fn.turntable.defaults = {
- axis: 'x'
- }
+ axis: 'x',
+ reverse: false,
+ scrollStart: 'middle'
+ };
-})(jQuery);
+})(jQuery);
@@ -0,0 +1,8 @@
+/*
+ * TurntableSlider
+ * v 1.1.1
+ *
+ * Copyright (c) 2016 Polar Notion
+ * Licensed under the MIT license.
+ */
+!function e(i,t,o){function a(r,s){if(!t[r]){if(!i[r]){var c="function"==typeof require&&require;if(!s&&c)return c(r,!0);if(n)return n(r,!0);var l=new Error("Cannot find module '"+r+"'");throw l.code="MODULE_NOT_FOUND",l}var m=t[r]={exports:{}};i[r][0].call(m.exports,function(e){var t=i[r][1][e];return a(t?t:e)},m,m.exports,e,i,t,o)}return t[r].exports}for(var n="function"==typeof require&&require,r=0;r<o.length;r++)a(o[r]);return a}({1:[function(e,i,t){"use strict";!function(e){e.fn.turntable=function(i){function t(i){var t,o=i.length;t="scroll"===n.axis?e(window).height():"y"===n.axis?r.height():r.width();for(var a=t/o,c=0;c<i.length;c++)s[c]={min:a*c,max:a+a*c,index:c};n.reverse===!0&&(s.reverse(),e.each(s,function(e,i){i.index=e}))}var o=function(){var e=!1;return function(i){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(i)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(i.substr(0,4)))&&(e=!0)}(navigator.userAgent||navigator.vendor||window.opera),e},a=e("ul",this).children(),n=e.extend({},e.fn.turntable.defaults,i),r=e(this),s=[];!function(i){a.each(function(){e(this).html('<img src="'+e(this).data("imgSrc")+'">')})}(),e("li:first-child>img",r).load(function(){e(this).parent().addClass("active"),t(a)}),e(window).resize(function(){t(a)});var c=function(i,t){e.each(i,function(){t>=this.min&&t<=this.max&&(a.removeClass("active"),a.eq(this.index).addClass("active"))})};return"scroll"===n.axis?e(window).scroll(function(){var i;i="bottom"===n.scrollStart?r.height():"top"===n.scrollStart?0:r.height()/2;var t=r.offset(),o=t.top-(e(window).scrollTop()-i);c(s,o)}):o()?r.on("touchmove",function(i){i.preventDefault();var t,o=e(this).offset(),a=i.originalEvent.touches[0]||i.originalEvent.changedTouches[0];t="y"===n.axis?a.pageY-o.top:a.pageX-o.left,c(s,t)}):r.on("mousemove",function(i){var t,o=e(this).offset();t="y"===n.axis?i.pageY-o.top:i.pageX-o.left,c(s,t)})},e.fn.turntable.defaults={axis:"x",reverse:!1,scrollStart:"middle"}}(jQuery)},{}]},{},[1]);
@@ -1,8 +0,0 @@
-/*
- * TurntableSlider
- * v 1.0.1
- *
- * Copyright (c) 2016 Polar Notion
- * Licensed under the MIT license.
- */
-!function i(e,t,a){function n(r,s){if(!t[r]){if(!e[r]){var c="function"==typeof require&&require;if(!s&&c)return c(r,!0);if(o)return o(r,!0);var m=new Error("Cannot find module '"+r+"'");throw m.code="MODULE_NOT_FOUND",m}var l=t[r]={exports:{}};e[r][0].call(l.exports,function(i){var t=e[r][1][i];return n(t?t:i)},l,l.exports,i,e,t,a)}return t[r].exports}for(var o="function"==typeof require&&require,r=0;r<a.length;r++)n(a[r]);return n}({1:[function(i,e,t){"use strict";!function(i){i.fn.turntable=function(e){function t(i){var e,t=i.length;e="y"===n.axis?o.height():o.width();for(var a=e/t,s=0;s<i.length;s++)r[s]={min:a*s,max:a+a*s,index:s}}var a=i("ul",this).children(),n=i.extend({},i.fn.turntable.defaults,e),o=i(this),r=[],s=function(){var i=!1;return function(e){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(i=!0)}(navigator.userAgent||navigator.vendor||window.opera),i};return function(e){a.each(function(){i(this).append('<img src="'+i(this).data("imgSrc")+'">')})}(),i("li:first-child>img",o).load(function(){i(this).parent().addClass("active"),t(a)}),i(window).resize(function(){t(a)}),s()?o.on("touchmove",function(e){e.preventDefault();var t,o=i(this).offset(),s=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0];t="y"===n.axis?s.pageY-o.top:s.pageX-o.left,i.each(r,function(){t>=this.min&&t<=this.max&&(a.removeClass("active"),a.eq(this.index).addClass("active"))})}):o.on("mousemove",function(e){var t,o=i(this).offset();t="y"===n.axis?e.pageY-o.top:e.pageX-o.left,i.each(r,function(){t>=this.min&&t<=this.max&&(a.removeClass("active"),a.eq(this.index).addClass("active"))})})},i.fn.turntable.defaults={axis:"x"}}(jQuery)},{}]},{},[1]);
Binary file not shown.
Oops, something went wrong.

0 comments on commit d0aeb06

Please sign in to comment.