Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial commit.

  • Loading branch information...
commit c8811a1a50a2f03fdc1f8e2b00d917b22ac26a7b 1 parent e6ac507
@gilbitron authored
View
3  README.md
@@ -1,4 +1 @@
-Lean-Slider
-===========
-
A Lean and Progressive Free jQuery Image Slider
View
BIN  demo/images/1.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/images/2.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/images/3.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/images/4.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/images/arrows.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/images/bullets.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
47 demo/index.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<html lang="en" class="no-js">
+<head>
+ <meta charset="utf-8" />
+
+ <title>Lean Slider Demo</title>
+
+ <link rel="stylesheet" href="style.css" type="text/css" media="screen" />
+ <script src="scripts/modernizr-2.6.1.min.js"></script>
+
+ <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
+ <script src="../lean-slider.js"></script>
+ <link rel="stylesheet" href="../lean-slider.css" type="text/css" />
+ <link rel="stylesheet" href="sample-styles.css" type="text/css" />
+</head>
+<body>
+
+ <div class="slider-wrapper">
+ <div id="slider">
+ <div class="slide1">
+ <img src="images/1.jpg" alt="" />
+ </div>
+ <div class="slide2">
+ <img src="images/2.jpg" alt="" />
+ </div>
+ <div class="slide3">
+ <img src="images/3.jpg" alt="" />
+ </div>
+ <div class="slide4">
+ <img src="images/4.jpg" alt="" />
+ </div>
+ </div>
+ <div id="slider-direction-nav"></div>
+ <div id="slider-control-nav"></div>
+ </div>
+
+ <script type="text/javascript">
+ $(document).ready(function() {
+ var slider = $('#slider').leanSlider({
+ directionNav: '#slider-direction-nav',
+ controlNav: '#slider-control-nav',
+ });
+ });
+ </script>
+
+</body>
+</html>
View
83 demo/sample-styles.css
@@ -0,0 +1,83 @@
+/*
+ * Lean Slider Sample Styles
+ * http://dev7studios.com
+ */
+
+.slider-wrapper {
+ position: relative;
+ background: #fff;
+ -moz-box-shadow: 0 0 3px rgba(0,0,0,0.4);
+ -webkit-box-shadow: 0 0 3px rgba(0,0,0,0.4);
+ box-shadow: 0 0 3px rgba(0,0,0,0.4);
+}
+.lean-slider { overflow: hidden; }
+.lean-slider-slide {
+ display: block;
+ position: relative;
+ opacity: 0;
+ -webkit-transition: opacity 0.6s linear;
+ -moz-transition: opacity 0.6s linear;
+ -ms-transition: opacity 0.6s linear;
+ -o-transition: opacity 0.6s linear;
+ transition: opacity 0.6s linear;
+}
+.lean-slider-slide.current { opacity: 1; }
+.lean-slider-slide img {
+ display: block;
+ width: 100%;
+}
+
+#slider-direction-nav {
+ position: absolute;
+ left: 0;
+ top: 47%;
+ width: 100%;
+ -webkit-transition: opacity 0.2s linear;
+ -moz-transition: opacity 0.2s linear;
+ -ms-transition: opacity 0.2s linear;
+ -o-transition: opacity 0.2s linear;
+ transition: opacity 0.2s linear;
+ opacity: 0.2;
+}
+.slider-wrapper:hover #slider-direction-nav { opacity: 1; }
+#slider-direction-nav a {
+ float: left;
+ display: block;
+ width: 26px;
+ height: 37px;
+ background: url(images/arrows.png) no-repeat 0 0;
+ text-indent: -9999px;
+}
+#slider-direction-nav .lean-slider-next {
+ float: right;
+ background-position: 100% 0;
+}
+
+#slider-control-nav {
+ position: absolute;
+ left: 0;
+ bottom: 10px;
+ width: 100%;
+ text-align: center;
+ -webkit-transition: opacity 0.2s linear;
+ -moz-transition: opacity 0.2s linear;
+ -ms-transition: opacity 0.2s linear;
+ -o-transition: opacity 0.2s linear;
+ transition: opacity 0.2s linear;
+ opacity: 0.2;
+}
+.slider-wrapper:hover #slider-control-nav { opacity: 1; }
+#slider-control-nav a {
+ display: inline-block;
+ width: 14px;
+ height: 14px;
+ background: url(images/bullets.png) no-repeat 0 0;
+ text-indent: -9999px;
+ margin: 0 3px;
+ -webkit-transition: none;
+ -moz-transition: none;
+ -ms-transition: none;
+ -o-transition: none;
+ transition: none;
+}
+#slider-control-nav a.active { background-position: 100% 0; }
View
4 demo/scripts/modernizr-2.6.1.min.js
@@ -0,0 +1,4 @@
+/* Modernizr 2.6.1 (Custom Build) | MIT & BSD
+ * Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-flexbox_legacy-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-cssclasses-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load
+ */
+;window.Modernizr=function(a,b,c){function C(a){j.cssText=a}function D(a,b){return C(n.join(a+";")+(b||""))}function E(a,b){return typeof a===b}function F(a,b){return!!~(""+a).indexOf(b)}function G(a,b){for(var d in a){var e=a[d];if(!F(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function H(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:E(f,"function")?f.bind(d||b):f}return!1}function I(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+p.join(d+" ")+d).split(" ");return E(b,"string")||E(b,"undefined")?G(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),H(e,b,c))}function J(){e.input=function(c){for(var d=0,e=c.length;d<e;d++)u[c[d]]=c[d]in k;return u.list&&(u.list=!!b.createElement("datalist")&&!!a.HTMLDataListElement),u}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),e.inputtypes=function(a){for(var d=0,e,f,h,i=a.length;d<i;d++)k.setAttribute("type",f=a[d]),e=k.type!=="text",e&&(k.value=l,k.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&k.style.WebkitAppearance!==c?(g.appendChild(k),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(k,null).WebkitAppearance!=="textfield"&&k.offsetHeight!==0,g.removeChild(k)):/^(search|tel)$/.test(f)||(/^(url|email)$/.test(f)?e=k.checkValidity&&k.checkValidity()===!1:e=k.value!=l)),t[a[d]]=!!e;return t}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var d="2.6.1",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k=b.createElement("input"),l=":)",m={}.toString,n=" -webkit- -moz- -o- -ms- ".split(" "),o="Webkit Moz O ms",p=o.split(" "),q=o.toLowerCase().split(" "),r={svg:"http://www.w3.org/2000/svg"},s={},t={},u={},v=[],w=v.slice,x,y=function(a,c,d,e){var f,i,j,k=b.createElement("div"),l=b.body,m=l?l:b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),k.appendChild(j);return f=["&#173;",'<style id="s',h,'">',a,"</style>"].join(""),k.id=h,(l?k:m).innerHTML+=f,m.appendChild(k),l||(m.style.background="",g.appendChild(m)),i=c(k,a),l?k.parentNode.removeChild(k):m.parentNode.removeChild(m),!!i},z=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=E(e[d],"function"),E(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),A={}.hasOwnProperty,B;!E(A,"undefined")&&!E(A.call,"undefined")?B=function(a,b){return A.call(a,b)}:B=function(a,b){return b in a&&E(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=w.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(w.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(w.call(arguments)))};return e}),s.flexbox=function(){return I("flexWrap")},s.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},s.canvastext=function(){return!!e.canvas&&!!E(b.createElement("canvas").getContext("2d").fillText,"function")},s.webgl=function(){return!!a.WebGLRenderingContext},s.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:y(["@media (",n.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},s.geolocation=function(){return"geolocation"in navigator},s.postmessage=function(){return!!a.postMessage},s.websqldatabase=function(){return!!a.openDatabase},s.indexedDB=function(){return!!I("indexedDB",a)},s.hashchange=function(){return z("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},s.history=function(){return!!a.history&&!!history.pushState},s.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},s.websockets=function(){return"WebSocket"in a||"MozWebSocket"in a},s.rgba=function(){return C("background-color:rgba(150,255,150,.5)"),F(j.backgroundColor,"rgba")},s.hsla=function(){return C("background-color:hsla(120,40%,100%,.5)"),F(j.backgroundColor,"rgba")||F(j.backgroundColor,"hsla")},s.multiplebgs=function(){return C("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(j.background)},s.backgroundsize=function(){return I("backgroundSize")},s.borderimage=function(){return I("borderImage")},s.borderradius=function(){return I("borderRadius")},s.boxshadow=function(){return I("boxShadow")},s.textshadow=function(){return b.createElement("div").style.textShadow===""},s.opacity=function(){return D("opacity:.55"),/^0.55$/.test(j.opacity)},s.cssanimations=function(){return I("animationName")},s.csscolumns=function(){return I("columnCount")},s.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return C((a+"-webkit- ".split(" ").join(b+a)+n.join(c+a)).slice(0,-a.length)),F(j.backgroundImage,"gradient")},s.cssreflections=function(){return I("boxReflect")},s.csstransforms=function(){return!!I("transform")},s.csstransforms3d=function(){var a=!!I("perspective");return a&&"webkitPerspective"in g.style&&y("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},s.csstransitions=function(){return I("transition")},s.fontface=function(){var a;return y('@font-face {font-family:"font";src:url("https://")}',function(c,d){var e=b.getElementById("smodernizr"),f=e.sheet||e.styleSheet,g=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"";a=/src/i.test(g)&&g.indexOf(d.split(" ")[0])===0}),a},s.generatedcontent=function(){var a;return y(['#modernizr:after{content:"',l,'";visibility:hidden}'].join(""),function(b){a=b.offsetHeight>=1}),a},s.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c},s.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,"")}catch(d){}return c},s.localstorage=function(){try{return localStorage.setItem(h,h),localStorage.removeItem(h),!0}catch(a){return!1}},s.sessionstorage=function(){try{return sessionStorage.setItem(h,h),sessionStorage.removeItem(h),!0}catch(a){return!1}},s.webworkers=function(){return!!a.Worker},s.applicationcache=function(){return!!a.applicationCache},s.svg=function(){return!!b.createElementNS&&!!b.createElementNS(r.svg,"svg").createSVGRect},s.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="<svg/>",(a.firstChild&&a.firstChild.namespaceURI)==r.svg},s.smil=function(){return!!b.createElementNS&&/SVGAnimate/.test(m.call(b.createElementNS(r.svg,"animate")))},s.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(m.call(b.createElementNS(r.svg,"clipPath")))};for(var K in s)B(s,K)&&(x=K.toLowerCase(),e[x]=s[K](),v.push((e[x]?"":"no-")+x));return e.input||J(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)B(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},C(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function p(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return r.shivMethods?n(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+l().join().replace(/\w+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(r,b.frag)}function q(a){a||(a=b);var c=m(a);return r.shivCSS&&!f&&!c.hasCSS&&(c.hasCSS=!!k(a,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),j||p(a,c),a}var c=a.html5||{},d=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,e=/^<|^(?:a|b|button|code|div|fieldset|form|h1|h2|h3|h4|h5|h6|i|iframe|img|input|label|li|link|ol|option|p|param|q|script|select|span|strong|style|table|tbody|td|textarea|tfoot|th|thead|tr|ul)$/i,f,g="_html5shiv",h=0,i={},j;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=n,e._domPrefixes=q,e._cssomPrefixes=p,e.hasEvent=z,e.testProp=function(a){return G([a])},e.testAllProps=I,e.testStyles=y,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+v.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};
View
172 demo/style.css
@@ -0,0 +1,172 @@
+/*=================================*/
+/* Lean Slider Demo
+/* October 2012
+/* By: Gilbert Pellegrom
+/* http://dev7studios.com
+/*=================================*/
+
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, font, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var,
+dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ outline: 0;
+ font-weight: inherit;
+ font-style: inherit;
+ font-size: 100%;
+ font-family: inherit;
+ vertical-align: baseline; }
+
+body {
+ line-height: 1;
+ color: black;
+ background: white; }
+
+table {
+ border-collapse: separate;
+ border-spacing: 0; }
+
+caption, th, td {
+ text-align: left;
+ font-weight: normal; }
+
+blockquote:before, blockquote:after,
+q:before, q:after {
+ content: ""; }
+
+blockquote, q {
+ quotes: "" ""; }
+
+/* HTML5 tags */
+header, section, footer,
+aside, nav, article, figure {
+ display: block; }
+
+/* hand cursor on clickable input elements */
+label, input[type=button], input[type=submit], button {
+ cursor: pointer; }
+
+/* make buttons play nice in IE:
+ www.viget.com/inspire/styling-the-button-element-in-internet-explorer/ */
+button {
+ width: auto;
+ overflow: visible; }
+
+/* Sharper Thumbnails */
+img {
+ -ms-interpolation-mode: bicubic; }
+
+input,
+textarea,
+select {
+ padding: 5px;
+ font: 400 1em Verdana, Sans-serif;
+ color: #666;
+ background: #fff;
+ border: 1px solid #999;
+ margin: 0 0 1em 0; }
+
+input:focus,
+textarea:focus,
+select:focus {
+ color: #000;
+ background: #fff;
+ border: 1px solid #666; }
+
+body {
+ font: 14px/1.6em "Helvetica Neue", Helvetica, Arial, sans-serif;
+ color: #333333;
+ background: #eee;
+ padding: 100px 20%;
+}
+
+a, a:visited {
+ color: #0088cc;
+ text-decoration: none;
+ -webkit-transition: all 0.2s linear;
+ -moz-transition: all 0.2s linear;
+ -ms-transition: all 0.2s linear;
+ -o-transition: all 0.2s linear;
+ transition: all 0.2s linear; }
+
+a:hover, a:active {
+ color: #333333;
+ text-decoration: underline; }
+
+h1, h2, h3, h4, h5, h6 {
+ line-height: 1.2em;
+ margin-bottom: 0.6em; }
+
+h1 {
+ font-size: 2.2em; }
+
+h2 {
+ font-size: 1.9em; }
+
+h3 {
+ font-size: 1.7em;
+ margin-top: 2em; }
+
+h4 {
+ font-size: 1.5em; }
+
+h5 {
+ font-size: 1.3em; }
+
+h6 {
+ font-size: 1.2em; }
+
+p {
+ margin-bottom: 1em; }
+
+ol, ul {
+ padding-left: 30px;
+ margin-bottom: 1em; }
+
+b, strong {
+ font-weight: bold; }
+
+i, em {
+ font-style: italic; }
+
+u {
+ text-decoration: underline; }
+
+abbr, acronym {
+ cursor: help;
+ border-bottom: .1em dotted; }
+
+td, td img {
+ vertical-align: top; }
+
+sub {
+ vertical-align: sub;
+ font-size: smaller; }
+
+sup {
+ vertical-align: super;
+ font-size: smaller; }
+
+code {
+ font-family: Courier, "Courier New", Monaco, Tahoma;
+ background: #eee;
+ color: #333;
+ padding: 0px 2px; }
+
+pre {
+ background: #eee;
+ padding: 20px;
+ margin-bottom: 1em;
+ overflow: auto; }
+
+blockquote {
+ font-style: italic;
+ margin: 0 0 1em 15px;
+ padding-left: 10px;
+ border-left: 5px solid #ddd; }
View
29 lean-slider.css
@@ -0,0 +1,29 @@
+/*
+ * Lean Slider v1.0
+ * http://dev7studios.com
+ *
+ * Copyright 2012, Dev7studios
+ * Free to use and abuse under the MIT license.
+ * http://www.opensource.org/licenses/mit-license.php
+ */
+
+.lean-slider {
+ position: relative;
+ *zoom: 1;
+}
+.lean-slider:before,
+.lean-slider:after {
+ content: " ";
+ display: table;
+}
+.lean-slider:after {
+ clear: both;
+}
+
+.lean-slider-slide {
+ float: left;
+ width: 100%;
+ margin-right: -100%;
+ display: none;
+}
+.lean-slider-slide.current { display: block; }
View
177 lean-slider.js
@@ -0,0 +1,177 @@
+/*
+ * Lean Slider v1.0
+ * http://dev7studios.com
+ *
+ * Copyright 2012, Dev7studios
+ * Free to use and abuse under the MIT license.
+ * http://www.opensource.org/licenses/mit-license.php
+ */
+
+;(function($) {
+
+ $.fn.leanSlider = function(options) {
+
+ // Defaults
+ var defaults = {
+ pauseTime: 4000,
+ pauseOnHover: true,
+ startSlide: 0,
+ directionNav: '',
+ directionNavPrevBuilder: '',
+ directionNavNextBuilder: '',
+ controlNav: '',
+ controlNavBuilder: '',
+ prevText: 'Prev',
+ nextText: 'Next',
+ beforeChange: function(){},
+ afterChange: function(){},
+ afterLoad: function(){}
+ };
+
+ // Set up plugin vars
+ var plugin = this,
+ settings = {},
+ slider = $(this),
+ slides = slider.children(),
+ currentSlide = 0,
+ timer = 0;
+
+ var init = function() {
+ // Set up settings
+ settings = $.extend({}, defaults, options);
+
+ // Add inital classes
+ slider.addClass('lean-slider');
+ slides.addClass('lean-slider-slide');
+
+ currentSlide = settings.startSlide;
+ if(settings.startSlide < 0 || settings.startSlide >= slides.length) currentSlide = 0;
+ $(slides[currentSlide]).addClass('current');
+
+ // Set up directionNav
+ if(settings.directionNav && $(settings.directionNav).length){
+ var prevNav = $('<a href="#" class="lean-slider-prev">'+ settings.prevText +'</a>'),
+ nextNav = $('<a href="#" class="lean-slider-next">'+ settings.nextText +'</a>');
+ if(settings.directionNavPrevBuilder) prevNav = $(settings.directionNavPrevBuilder.call(this, settings.prevText));
+ if(settings.directionNavNextBuilder) nextNav = $(settings.directionNavNextBuilder.call(this, settings.nextText));
+
+ prevNav.on('click', function(e){
+ e.preventDefault();
+ plugin.prev();
+ });
+ nextNav.on('click', function(e){
+ e.preventDefault();
+ plugin.next();
+ });
+
+ $(settings.directionNav).append(prevNav);
+ $(settings.directionNav).append(nextNav);
+ }
+
+ // Set up controlNav
+ if(settings.controlNav && $(settings.controlNav).length){
+ slides.each(function(i){
+ var controlNav = $('<a href="#" class="lean-slider-control-nav">'+ (i + 1) +'</a>');
+ if(settings.controlNavBuilder) controlNav = $(settings.controlNavBuilder.call(this, i));
+
+ controlNav.on('click', function(e){
+ e.preventDefault();
+ plugin.show(i);
+ });
+
+ $(settings.controlNav).append(controlNav);
+ });
+ }
+
+ // Set up pauseOnHover
+ if(settings.pauseOnHover && settings.pauseTime && settings.pauseTime > 0){
+ slider.hover(
+ function () {
+ clearTimeout(timer);
+ },
+ function () {
+ doTimer();
+ }
+ );
+ }
+
+ // Initial processing
+ updateControlNav();
+ doTimer();
+
+ // Trigger the afterLoad callback
+ settings.afterLoad.call(this);
+
+ return plugin;
+ };
+
+ // Process timer
+ var doTimer = function(){
+ if(settings.pauseTime && settings.pauseTime > 0){
+ clearTimeout(timer);
+ timer = setTimeout(function(){ plugin.next(); }, settings.pauseTime);
+ }
+ };
+
+ // Update controlNav
+ var updateControlNav = function(){
+ if(settings.controlNav){
+ $('.lean-slider-control-nav', settings.controlNav).removeClass('active');
+ $($('.lean-slider-control-nav', settings.controlNav).get(currentSlide)).addClass('active');
+ }
+ };
+
+ // Prev
+ plugin.prev = function(){
+ // Trigger the beforeChange callback
+ settings.beforeChange.call(this, currentSlide);
+
+ currentSlide--;
+ if(currentSlide < 0) currentSlide = slides.length - 1;
+ slides.removeClass('current');
+ $(slides[currentSlide]).addClass('current');
+ updateControlNav();
+ doTimer();
+
+ // Trigger the afterChange callback
+ settings.afterChange.call(this, currentSlide);
+ };
+
+ // Next
+ plugin.next = function(){
+ // Trigger the beforeChange callback
+ settings.beforeChange.call(this, currentSlide);
+
+ currentSlide++;
+ if(currentSlide >= slides.length) currentSlide = 0;
+ slides.removeClass('current');
+ $(slides[currentSlide]).addClass('current');
+ updateControlNav();
+ doTimer();
+
+ // Trigger the afterChange callback
+ settings.afterChange.call(this, currentSlide);
+ };
+
+ // Show
+ plugin.show = function(index){
+ // Trigger the beforeChange callback
+ settings.beforeChange.call(this, currentSlide);
+
+ currentSlide = index;
+ if(currentSlide < 0) currentSlide = slides.length - 1;
+ if(currentSlide >= slides.length) currentSlide = 0;
+ slides.removeClass('current');
+ $(slides[currentSlide]).addClass('current');
+ updateControlNav();
+ doTimer();
+
+ // Trigger the afterChange callback
+ settings.afterChange.call(this, currentSlide);
+ };
+
+ // Call constructor
+ return init();
+ };
+
+})(jQuery);
View
22 license.txt
@@ -0,0 +1,22 @@
+ Copyright (c) 2012 Dev7studios
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
Please sign in to comment.
Something went wrong with that request. Please try again.