├── .nojekyll ├── .gitignore ├── lib ├── tpl │ ├── footer.tpl │ └── header.tpl ├── ios-orientationchange-fix.js └── jquery.mousewheel.js ├── javascripts └── main.js ├── images ├── bg_hr.png ├── blacktocat.png ├── icon_download.png └── sprite_download.png ├── .eslintrc.js ├── bower.json ├── jcarousellite.jquery.json ├── LICENSE-MIT ├── package.json ├── demo ├── centered.html ├── responsive.html ├── velocity.html ├── refresh.html └── index.html ├── test ├── qunit │ ├── qunit.css │ └── qunit.js ├── index.html └── tests.js ├── stylesheets ├── pygment_trac.css └── stylesheet.css ├── Gruntfile.js ├── jcarousellite.min.js ├── readme.md ├── src └── jquery.jcarousellite.js └── jcarousellite.js /.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *DS_Store -------------------------------------------------------------------------------- /lib/tpl/footer.tpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /javascripts/main.js: -------------------------------------------------------------------------------- 1 | console.log('This would be the main JS file.'); 2 | -------------------------------------------------------------------------------- /images/bg_hr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kswedberg/jquery-carousel-lite/HEAD/images/bg_hr.png -------------------------------------------------------------------------------- /images/blacktocat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kswedberg/jquery-carousel-lite/HEAD/images/blacktocat.png -------------------------------------------------------------------------------- /images/icon_download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kswedberg/jquery-carousel-lite/HEAD/images/icon_download.png -------------------------------------------------------------------------------- /images/sprite_download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kswedberg/jquery-carousel-lite/HEAD/images/sprite_download.png -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | 'extends': 'kswedberg/es5', 3 | rules: { 4 | 'no-unused-vars': 'warn' 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery.jcarousellite", 3 | "version": "1.9.3", 4 | "title": "jCarousel Lite", 5 | "description": "A jQuery carousel plugin based on jCarouselLite by Ganeshji Marwaha", 6 | "author": { 7 | "name": "Karl Swedberg", 8 | "email": "kswedberg@gmail.com", 9 | "url": "http://www.learningjquery.com/" 10 | }, 11 | "licenses": [ 12 | { 13 | "type": "MIT", 14 | "url": "http://kswedberg.github.com/jquery-carousel-lite/blob/master/LICENSE-MIT" 15 | } 16 | ], 17 | "dependencies": { 18 | "jquery": ">=1.4" 19 | }, 20 | "main": "jcarousellite.js", 21 | "ignore": [ 22 | "demo/", 23 | "lib/", 24 | "test/", 25 | "src/", 26 | "Gruntfile.js", 27 | "package.json", 28 | "jcarousellite.jquery.json" 29 | ] 30 | } -------------------------------------------------------------------------------- /jcarousellite.jquery.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jcarousellite", 3 | "title": "jCarousel Lite", 4 | "description": "A jQuery carousel plugin based on jCarouselLite by Ganeshji Marwaha", 5 | "version": "1.9.3", 6 | "homepage": "http://kswedberg.github.com/jquery-carousel-lite/", 7 | "author": { 8 | "name": "Karl Swedberg", 9 | "email": "kswedberg@gmail.com", 10 | "url": "http://www.learningjquery.com/" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git://github.com/kswedberg/jquery-carousel-lite.git" 15 | }, 16 | "homepage": "http://kswedberg.github.com/jquery-carousel-lite/", 17 | "bugs": { 18 | "url": "https://github.com/kswedberg/jquery-carousel-lite/issues" 19 | }, 20 | "licenses": [ 21 | { 22 | "type": "MIT", 23 | "url": "http://kswedberg.github.com/jquery-carousel-lite/blob/master/LICENSE-MIT" 24 | } 25 | ], 26 | "dependencies": { 27 | "jquery": ">=1.4" 28 | }, 29 | "keywords": [] 30 | } 31 | -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Karl Swedberg 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jcarousellite", 3 | "title": "jCarousel Lite", 4 | "description": "A jQuery carousel plugin based on jCarouselLite by Ganeshji Marwaha", 5 | "version": "1.9.3", 6 | "author": { 7 | "name": "Karl Swedberg", 8 | "email": "kswedberg@gmail.com" 9 | }, 10 | "contributors": [ 11 | { 12 | "name": "Ganeshji Marwaha", 13 | "url": "http://gmarwaha.com" 14 | } 15 | ], 16 | "repository": { 17 | "type": "git", 18 | "url": "git://github.com/kswedberg/jquery-carousel-lite.git" 19 | }, 20 | "homepage": "http://kswedberg.github.com/jquery-carousel-lite/", 21 | "dependencies": { 22 | "jquery": ">=1.4" 23 | }, 24 | "devDependencies": { 25 | "eslint-config-kswedberg": "^5.1.1", 26 | "grunt": "^1.5.3", 27 | "grunt-contrib-concat": "^2.1.0", 28 | "grunt-contrib-jshint": "^3.2.0", 29 | "grunt-contrib-uglify": "^5.2.2", 30 | "grunt-contrib-watch": "^1.1.0", 31 | "grunt-eslint": "^24.0.0", 32 | "grunt-version": "^3.0.0", 33 | "marked": "^4.1.0", 34 | "node-syntaxhighlighter": "^0.8.1" 35 | }, 36 | "licenses": [ 37 | { 38 | "type": "MIT", 39 | "url": "http://kswedberg.github.com/jquery-carousel-lite/blob/master/LICENSE-MIT" 40 | } 41 | ], 42 | "keywords": [ 43 | "jquery-plugin", 44 | "ecosystem:jquery", 45 | "carousel", 46 | "slideshow" 47 | ] 48 | } 49 | -------------------------------------------------------------------------------- /lib/tpl/header.tpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | jQuery <%= pkg.title %> Plugin 7 | 71 | 72 | 73 | 74 |
Demo
75 | -------------------------------------------------------------------------------- /lib/ios-orientationchange-fix.js: -------------------------------------------------------------------------------- 1 | /*! A fix for the iOS orientationchange zoom bug. 2 | Script by @scottjehl, rebound by @wilto. 3 | MIT / GPLv2 License. 4 | */ 5 | (function(w){ 6 | 7 | // This fix addresses an iOS bug, so return early if the UA claims it's something else. 8 | var ua = navigator.userAgent; 9 | if( !( /iPhone|iPad|iPod/.test( navigator.platform ) && /OS [1-5]_[0-9_]* like Mac OS X/i.test(ua) && ua.indexOf( "AppleWebKit" ) > -1 ) ){ 10 | return; 11 | } 12 | 13 | var doc = w.document; 14 | 15 | if( !doc.querySelector ){ return; } 16 | 17 | var meta = doc.querySelector( "meta[name=viewport]" ), 18 | initialContent = meta && meta.getAttribute( "content" ), 19 | disabledZoom = initialContent + ",maximum-scale=1", 20 | enabledZoom = initialContent + ",maximum-scale=10", 21 | enabled = true, 22 | x, y, z, aig; 23 | 24 | if( !meta ){ return; } 25 | 26 | function restoreZoom(){ 27 | window.setTimeout(function() { 28 | enabled = true; 29 | }, 50); 30 | } 31 | 32 | function disableZoom(){ 33 | meta.setAttribute( "content", disabledZoom ); 34 | enabled = false; 35 | 36 | } 37 | 38 | function checkTilt( e ){ 39 | aig = e.accelerationIncludingGravity; 40 | x = Math.abs( aig.x ); 41 | y = Math.abs( aig.y ); 42 | z = Math.abs( aig.z ); 43 | 44 | // If portrait orientation and in one of the danger zones 45 | if( (!w.orientation || w.orientation === 180) && ( x > 7 || ( ( z > 6 && y < 8 || z < 8 && y > 6 ) && x > 5 ) ) ){ 46 | if( enabled ){ 47 | disableZoom(); 48 | } 49 | } 50 | else if( !enabled ){ 51 | restoreZoom(); 52 | } 53 | } 54 | 55 | w.addEventListener( "orientationchange", restoreZoom, false ); 56 | w.addEventListener( "devicemotion", checkTilt, false ); 57 | 58 | })( this ); 59 | -------------------------------------------------------------------------------- /demo/centered.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | demo 6 | 61 | 62 | 63 | 64 | 83 | 84 | 85 |
86 |
87 | 96 | 97 |
98 | 99 | 108 | 109 |
110 | 111 | 112 | -------------------------------------------------------------------------------- /lib/jquery.mousewheel.js: -------------------------------------------------------------------------------- 1 | /*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net) 2 | * Licensed under the MIT License (LICENSE.txt). 3 | * 4 | * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. 5 | * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. 6 | * Thanks to: Seamus Leahy for adding deltaX and deltaY 7 | * 8 | * Version: 3.0.6 9 | * 10 | * Requires: 1.2.2+ 11 | */ 12 | 13 | (function($) { 14 | 15 | var types = ['DOMMouseScroll', 'mousewheel']; 16 | 17 | if ($.event.fixHooks) { 18 | for ( var i=types.length; i; ) { 19 | $.event.fixHooks[ types[--i] ] = $.event.mouseHooks; 20 | } 21 | } 22 | 23 | $.event.special.mousewheel = { 24 | setup: function() { 25 | if ( this.addEventListener ) { 26 | for ( var i=types.length; i; ) { 27 | this.addEventListener( types[--i], handler, false ); 28 | } 29 | } else { 30 | this.onmousewheel = handler; 31 | } 32 | }, 33 | 34 | teardown: function() { 35 | if ( this.removeEventListener ) { 36 | for ( var i=types.length; i; ) { 37 | this.removeEventListener( types[--i], handler, false ); 38 | } 39 | } else { 40 | this.onmousewheel = null; 41 | } 42 | } 43 | }; 44 | 45 | $.fn.extend({ 46 | mousewheel: function(fn) { 47 | return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel"); 48 | }, 49 | 50 | unmousewheel: function(fn) { 51 | return this.unbind("mousewheel", fn); 52 | } 53 | }); 54 | 55 | 56 | function handler(event) { 57 | var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0; 58 | event = $.event.fix(orgEvent); 59 | event.type = "mousewheel"; 60 | 61 | // Old school scrollwheel delta 62 | if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta/120; } 63 | if ( orgEvent.detail ) { delta = -orgEvent.detail/3; } 64 | 65 | // New school multidimensional scroll (touchpads) deltas 66 | deltaY = delta; 67 | 68 | // Gecko 69 | if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) { 70 | deltaY = 0; 71 | deltaX = -1*delta; 72 | } 73 | 74 | // Webkit 75 | if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; } 76 | if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; } 77 | 78 | // Add event and delta to the front of the arguments 79 | args.unshift(event, delta, deltaX, deltaY); 80 | 81 | return ($.event.dispatch || $.event.handle).apply(this, args); 82 | } 83 | 84 | })(jQuery); -------------------------------------------------------------------------------- /test/qunit/qunit.css: -------------------------------------------------------------------------------- 1 | /** Font Family and Sizes */ 2 | 3 | #qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult { 4 | font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial; 5 | } 6 | 7 | #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; } 8 | #qunit-tests { font-size: smaller; } 9 | 10 | 11 | /** Resets */ 12 | 13 | #qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult { 14 | margin: 0; 15 | padding: 0; 16 | } 17 | 18 | 19 | /** Header */ 20 | 21 | #qunit-header { 22 | padding: 0.5em 0 0.5em 1em; 23 | 24 | color: #fff; 25 | text-shadow: rgba(0, 0, 0, 0.5) 4px 4px 1px; 26 | background-color: #0d3349; 27 | 28 | border-radius: 15px 15px 0 0; 29 | -moz-border-radius: 15px 15px 0 0; 30 | -webkit-border-top-right-radius: 15px; 31 | -webkit-border-top-left-radius: 15px; 32 | } 33 | 34 | #qunit-header a { 35 | text-decoration: none; 36 | color: white; 37 | } 38 | 39 | #qunit-banner { 40 | height: 5px; 41 | } 42 | 43 | #qunit-testrunner-toolbar { 44 | padding: 0em 0 0.5em 2em; 45 | } 46 | 47 | #qunit-userAgent { 48 | padding: 0.5em 0 0.5em 2.5em; 49 | background-color: #2b81af; 50 | color: #fff; 51 | text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px; 52 | } 53 | 54 | 55 | /** Tests: Pass/Fail */ 56 | 57 | #qunit-tests { 58 | list-style-position: inside; 59 | } 60 | 61 | #qunit-tests li { 62 | padding: 0.4em 0.5em 0.4em 2.5em; 63 | border-bottom: 1px solid #fff; 64 | list-style-position: inside; 65 | } 66 | 67 | #qunit-tests li strong { 68 | cursor: pointer; 69 | } 70 | 71 | #qunit-tests ol { 72 | margin-top: 0.5em; 73 | padding: 0.5em; 74 | 75 | background-color: #fff; 76 | 77 | border-radius: 15px; 78 | -moz-border-radius: 15px; 79 | -webkit-border-radius: 15px; 80 | 81 | box-shadow: inset 0px 2px 13px #999; 82 | -moz-box-shadow: inset 0px 2px 13px #999; 83 | -webkit-box-shadow: inset 0px 2px 13px #999; 84 | } 85 | 86 | /*** Test Counts */ 87 | 88 | #qunit-tests b.counts { color: black; } 89 | #qunit-tests b.passed { color: #5E740B; } 90 | #qunit-tests b.failed { color: #710909; } 91 | 92 | #qunit-tests li li { 93 | margin: 0.5em; 94 | padding: 0.4em 0.5em 0.4em 0.5em; 95 | background-color: #fff; 96 | border-bottom: none; 97 | list-style-position: inside; 98 | } 99 | 100 | /*** Passing Styles */ 101 | 102 | #qunit-tests li li.pass { 103 | color: #5E740B; 104 | background-color: #fff; 105 | border-left: 26px solid #C6E746; 106 | } 107 | 108 | #qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; } 109 | #qunit-tests .pass .test-name { color: #366097; } 110 | 111 | #qunit-tests .pass .test-actual, 112 | #qunit-tests .pass .test-expected { color: #999999; } 113 | 114 | #qunit-banner.qunit-pass { background-color: #C6E746; } 115 | 116 | /*** Failing Styles */ 117 | 118 | #qunit-tests li li.fail { 119 | color: #710909; 120 | background-color: #fff; 121 | border-left: 26px solid #EE5757; 122 | } 123 | 124 | #qunit-tests .fail { color: #000000; background-color: #EE5757; } 125 | #qunit-tests .fail .test-name, 126 | #qunit-tests .fail .module-name { color: #000000; } 127 | 128 | #qunit-tests .fail .test-actual { color: #EE5757; } 129 | #qunit-tests .fail .test-expected { color: green; } 130 | 131 | #qunit-banner.qunit-fail, 132 | #qunit-testrunner-toolbar { background-color: #EE5757; } 133 | 134 | 135 | /** Footer */ 136 | 137 | #qunit-testresult { 138 | padding: 0.5em 0.5em 0.5em 2.5em; 139 | 140 | color: #2b81af; 141 | background-color: #D2E0E6; 142 | 143 | border-radius: 0 0 15px 15px; 144 | -moz-border-radius: 0 0 15px 15px; 145 | -webkit-border-bottom-right-radius: 15px; 146 | -webkit-border-bottom-left-radius: 15px; 147 | } 148 | 149 | /** Fixture */ 150 | 151 | #qunit-fixture { 152 | position: absolute; 153 | top: -10000px; 154 | left: -10000px; 155 | } 156 | -------------------------------------------------------------------------------- /demo/responsive.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | demo 7 | 8 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 86 | 87 | 88 |
89 |

Instructions

90 |
91 | 124 | 125 | 126 |
127 | 128 | 129 | 130 |
131 | 132 | 133 | -------------------------------------------------------------------------------- /stylesheets/pygment_trac.css: -------------------------------------------------------------------------------- 1 | .highlight .hll { background-color: #ffffcc } 2 | .highlight { background: #f0f3f3; } 3 | .highlight .c { color: #0099FF; font-style: italic } /* Comment */ 4 | .highlight .err { color: #AA0000; background-color: #FFAAAA } /* Error */ 5 | .highlight .k { color: #006699; font-weight: bold } /* Keyword */ 6 | .highlight .o { color: #555555 } /* Operator */ 7 | .highlight .cm { color: #0099FF; font-style: italic } /* Comment.Multiline */ 8 | .highlight .cp { color: #009999 } /* Comment.Preproc */ 9 | .highlight .c1 { color: #0099FF; font-style: italic } /* Comment.Single */ 10 | .highlight .cs { color: #0099FF; font-weight: bold; font-style: italic } /* Comment.Special */ 11 | .highlight .gd { background-color: #FFCCCC; border: 1px solid #CC0000 } /* Generic.Deleted */ 12 | .highlight .ge { font-style: italic } /* Generic.Emph */ 13 | .highlight .gr { color: #FF0000 } /* Generic.Error */ 14 | .highlight .gh { color: #003300; font-weight: bold } /* Generic.Heading */ 15 | .highlight .gi { background-color: #CCFFCC; border: 1px solid #00CC00 } /* Generic.Inserted */ 16 | .highlight .go { color: #AAAAAA } /* Generic.Output */ 17 | .highlight .gp { color: #000099; font-weight: bold } /* Generic.Prompt */ 18 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 19 | .highlight .gu { color: #003300; font-weight: bold } /* Generic.Subheading */ 20 | .highlight .gt { color: #99CC66 } /* Generic.Traceback */ 21 | .highlight .kc { color: #006699; font-weight: bold } /* Keyword.Constant */ 22 | .highlight .kd { color: #006699; font-weight: bold } /* Keyword.Declaration */ 23 | .highlight .kn { color: #006699; font-weight: bold } /* Keyword.Namespace */ 24 | .highlight .kp { color: #006699 } /* Keyword.Pseudo */ 25 | .highlight .kr { color: #006699; font-weight: bold } /* Keyword.Reserved */ 26 | .highlight .kt { color: #007788; font-weight: bold } /* Keyword.Type */ 27 | .highlight .m { color: #FF6600 } /* Literal.Number */ 28 | .highlight .s { color: #CC3300 } /* Literal.String */ 29 | .highlight .na { color: #330099 } /* Name.Attribute */ 30 | .highlight .nb { color: #336666 } /* Name.Builtin */ 31 | .highlight .nc { color: #00AA88; font-weight: bold } /* Name.Class */ 32 | .highlight .no { color: #336600 } /* Name.Constant */ 33 | .highlight .nd { color: #9999FF } /* Name.Decorator */ 34 | .highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */ 35 | .highlight .ne { color: #CC0000; font-weight: bold } /* Name.Exception */ 36 | .highlight .nf { color: #CC00FF } /* Name.Function */ 37 | .highlight .nl { color: #9999FF } /* Name.Label */ 38 | .highlight .nn { color: #00CCFF; font-weight: bold } /* Name.Namespace */ 39 | .highlight .nt { color: #330099; font-weight: bold } /* Name.Tag */ 40 | .highlight .nv { color: #003333 } /* Name.Variable */ 41 | .highlight .ow { color: #000000; font-weight: bold } /* Operator.Word */ 42 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */ 43 | .highlight .mf { color: #FF6600 } /* Literal.Number.Float */ 44 | .highlight .mh { color: #FF6600 } /* Literal.Number.Hex */ 45 | .highlight .mi { color: #FF6600 } /* Literal.Number.Integer */ 46 | .highlight .mo { color: #FF6600 } /* Literal.Number.Oct */ 47 | .highlight .sb { color: #CC3300 } /* Literal.String.Backtick */ 48 | .highlight .sc { color: #CC3300 } /* Literal.String.Char */ 49 | .highlight .sd { color: #CC3300; font-style: italic } /* Literal.String.Doc */ 50 | .highlight .s2 { color: #CC3300 } /* Literal.String.Double */ 51 | .highlight .se { color: #CC3300; font-weight: bold } /* Literal.String.Escape */ 52 | .highlight .sh { color: #CC3300 } /* Literal.String.Heredoc */ 53 | .highlight .si { color: #AA0000 } /* Literal.String.Interpol */ 54 | .highlight .sx { color: #CC3300 } /* Literal.String.Other */ 55 | .highlight .sr { color: #33AAAA } /* Literal.String.Regex */ 56 | .highlight .s1 { color: #CC3300 } /* Literal.String.Single */ 57 | .highlight .ss { color: #FFCC33 } /* Literal.String.Symbol */ 58 | .highlight .bp { color: #336666 } /* Name.Builtin.Pseudo */ 59 | .highlight .vc { color: #003333 } /* Name.Variable.Class */ 60 | .highlight .vg { color: #003333 } /* Name.Variable.Global */ 61 | .highlight .vi { color: #003333 } /* Name.Variable.Instance */ 62 | .highlight .il { color: #FF6600 } /* Literal.Number.Integer.Long */ 63 | 64 | .type-csharp .highlight .k { color: #0000FF } 65 | .type-csharp .highlight .kt { color: #0000FF } 66 | .type-csharp .highlight .nf { color: #000000; font-weight: normal } 67 | .type-csharp .highlight .nc { color: #2B91AF } 68 | .type-csharp .highlight .nn { color: #000000 } 69 | .type-csharp .highlight .s { color: #A31515 } 70 | .type-csharp .highlight .sc { color: #A31515 } 71 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | /* global module:false*/ 2 | module.exports = function(grunt) { 3 | 4 | var _ = grunt.util._; 5 | var m = require('marked'); 6 | var marked = m.marked; 7 | // var hl = require('highlight').Highlight; 8 | var hl = require('node-syntaxhighlighter'); 9 | 10 | marked.setOptions({ 11 | highlight: function(code, lang) { 12 | 13 | lang = hl.getLanguage(lang); 14 | 15 | return hl.highlight(code, lang); 16 | }, 17 | gfm: true 18 | }); 19 | 20 | // Project configuration. 21 | grunt.initConfig({ 22 | pkg: grunt.file.readJSON('jcarousellite.jquery.json'), 23 | bowerjson: './bower.json', 24 | meta: { 25 | banner: '/*!<%= "\\n" %>' + 26 | ' * <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' + 27 | '<%= grunt.template.today("yyyy-mm-dd") + "\\n" %>' + 28 | '<%= pkg.homepage ? " * " + pkg.homepage + "\\n" : "" %>' + 29 | ' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>' + 30 | '<%= "\\n" %>' + 31 | ' * based on the original by Ganeshji Marwaha (gmarwaha.com)' + 32 | '<%= "\\n" %>' + 33 | ' * Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %>' + 34 | ' (<%= _.pluck(pkg.licenses, "url").join(", ") %>)' + 35 | '<%= "\\n" %>' + ' */' + 36 | '<%= "\\n\\n" %>' 37 | }, 38 | concat: { 39 | all: { 40 | src: ['src/jquery.<%= pkg.name %>.js'], 41 | dest: '<%= pkg.name %>.js' 42 | }, 43 | options: { 44 | stripBanners: true, 45 | banner: '<%= meta.banner %>' 46 | } 47 | }, 48 | uglify: { 49 | all: { 50 | files: { 51 | '<%= pkg.name %>.min.js': ['<%= concat.all.dest %>'] 52 | }, 53 | options: { 54 | preserveComments: false, 55 | banner: '<%= meta.banner %>' 56 | } 57 | } 58 | }, 59 | watch: { 60 | scripts: { 61 | files: '<%= jshint.all %>', 62 | tasks: ['jshint'] 63 | }, 64 | docs: { 65 | files: ['readme.md', 'lib/tpl/**/*.tpl', 'Gruntfile.js'], 66 | tasks: ['docs'] 67 | } 68 | }, 69 | eslint: { 70 | all: ['Gruntfile.js', 'src/**/*.js'], 71 | options: { 72 | configFile: '.eslintrc.js' 73 | } 74 | }, 75 | jshint: { 76 | all: ['Gruntfile.js', 'src/**/*.js'], 77 | options: { 78 | curly: true, 79 | // eqeqeq: true, 80 | // immed: true, 81 | latedef: true, 82 | newcap: true, 83 | noarg: true, 84 | sub: true, 85 | undef: true, 86 | boss: true, 87 | eqnull: true, 88 | browser: true, 89 | globals: { 90 | jQuery: true, 91 | require: false 92 | } 93 | } 94 | }, 95 | version: { 96 | all: { 97 | src: ['src/*.js', '*.json'] 98 | }, 99 | banner: { 100 | src: ['<%= pkg.name %>.js'], 101 | options: { 102 | prefix: 'Lite - v' 103 | } 104 | } 105 | } 106 | }); 107 | 108 | grunt.registerMultiTask('setshell', 'Set grunt shell commands', function() { 109 | var settings, cmd; 110 | var tgt = this.target; 111 | var cmdLabel = 'shell.' + tgt + '.command'; 112 | var file = this.data.file; 113 | var append = this.data.cmdAppend || ''; 114 | 115 | if (!grunt.file.exists(file)) { 116 | grunt.warn('File does not exist: ' + file); 117 | } 118 | 119 | settings = grunt.file.readJSON(file); 120 | 121 | if (!settings[tgt]) { 122 | grunt.warn('No ' + tgt + ' property found in ' + file); 123 | } 124 | 125 | cmd = settings[tgt] + append; 126 | grunt.config(cmdLabel, cmd); 127 | grunt.log.writeln(('Setting ' + cmdLabel + ' to:').cyan); 128 | 129 | grunt.log.writeln(cmd); 130 | 131 | }); 132 | 133 | grunt.registerTask('bower', 'update bower.json', function() { 134 | var comp = grunt.config('bowerjson'); 135 | var pkg = grunt.file.readJSON('jcarousellite.jquery.json'); 136 | var json = {}; 137 | 138 | ['name', 'version', 'title', 'description', 'author', 'licenses', 'dependencies'].forEach(function(el) { 139 | json[el] = pkg[el]; 140 | }); 141 | 142 | _.extend(json, { 143 | main: grunt.config('concat.all.dest'), 144 | ignore: [ 145 | 'demo/', 146 | 'lib/', 147 | 'test/', 148 | 'src/', 149 | 'Gruntfile.js', 150 | 'package.json', 151 | 'jcarousellite.jquery.json' 152 | ] 153 | }); 154 | json.name = 'jquery.' + json.name; 155 | 156 | grunt.file.write(comp, JSON.stringify(json, null, 2)); 157 | grunt.log.writeln('File "' + comp + ' updated."'); 158 | }); 159 | 160 | grunt.registerTask('docs', function() { 161 | var doc; 162 | var readme = grunt.file.read('readme.md'); 163 | var head = grunt.template.process(grunt.file.read('lib/tpl/header.tpl')); 164 | var foot = grunt.file.read('lib/tpl/footer.tpl'); 165 | 166 | // Convert to markdown (with the highlight.js processing in setOptions.highlight) 167 | doc = marked(readme); 168 | // Remove function foo() {} after processing 169 | // doc = doc.replace(/function<\/span> foo\(\) \{\}(\n)?/g, ''); 170 | 171 | grunt.file.write('index.html', head + doc + foot); 172 | 173 | }); 174 | 175 | grunt.registerTask('build', ['eslint', 'version', 'concat', 'bower', 'uglify', 'docs']); 176 | grunt.registerTask('patch', ['eslint', 'version::patch', 'concat', 'bower', 'uglify']); 177 | 178 | grunt.loadNpmTasks('grunt-contrib-jshint'); 179 | grunt.loadNpmTasks('grunt-contrib-uglify'); 180 | grunt.loadNpmTasks('grunt-contrib-concat'); 181 | grunt.loadNpmTasks('grunt-contrib-watch'); 182 | grunt.loadNpmTasks('grunt-eslint'); 183 | grunt.loadNpmTasks('grunt-version'); 184 | }; 185 | -------------------------------------------------------------------------------- /test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jCarousel Lite Plugin Tests 5 | 6 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 |

jCarousel Lite Plugin Tests

51 |

52 |
53 |

54 |
    55 |
    56 |
    57 |
      58 | 59 |
    • 60 |
      Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. 61 |
      62 |
    • 63 | 64 |
    • 65 |
      Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 66 | Green Roof 67 |
      68 |
    • 69 | 70 | 71 |
    • 72 |
      Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 73 | Zeeland 74 |
      75 |
    • 76 | 77 |
    • 78 |
      79 | In culpa qui officia deserunt mollit anim id est laborum. 80 | CityFlats Hotel 81 | 82 |
      83 |
    • 84 | 85 |
    • 86 |
      Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 87 |
      88 |
    • 89 | 90 |
    91 | 92 | 93 |
    94 | 95 |
    96 |
      97 | 98 |
    • 99 |
      Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. 100 |
      101 |
    • 102 | 103 |
    • 104 |
      Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 105 | GRCC Green Roof 106 |
      107 |
    • 108 | 109 | 110 |
    • 111 |
      Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 112 | Zeeland Natatorium 113 |
      114 |
    • 115 | 116 |
    • 117 |
      118 | In culpa qui officia deserunt mollit anim id est laborum. 119 | CityFlats Hotel 120 | 121 |
      122 |
    • 123 | 124 |
    • 125 |
      Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 126 | Calvin College 127 |
      128 |
    • 129 | 130 |
    131 | 132 | 133 |
    134 | 135 |
    136 | 137 | 138 | 139 | -------------------------------------------------------------------------------- /demo/velocity.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | demo 6 | 57 | 58 | 59 | 60 | 97 | 98 | 99 |
    100 |

    "Responsive" demo

    101 |
    102 |
      103 | 104 |
    • 105 |
      1 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. 106 |
      107 |
    • 108 | 109 |
    • 110 |
      2 Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 111 | Green Roof 112 |
      113 |
    • 114 | 115 | 116 |
    • 117 |
      3 Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 118 | Zeeland 119 |
      120 |
    • 121 | 122 |
    • 123 |
      4 124 | In culpa qui officia deserunt mollit anim id est laborum. 125 | CityFlats Hotel 126 | 127 |
      128 |
    • 129 | 130 |
    • 131 |
      5 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 132 |
      133 |
    • 134 | 135 |
    136 | 137 | 138 |
    139 | 140 |
    141 |
      142 | 143 |
    • 144 |
      1 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. 145 |
      146 |
    • 147 | 148 |
    • 149 |
      2 Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 150 | GRCC Green Roof 151 |
      152 |
    • 153 | 154 | 155 |
    • 156 |
      3 Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 157 | Zeeland Natatorium 158 |
      159 |
    • 160 | 161 |
    • 162 |
      4 163 | In culpa qui officia deserunt mollit anim id est laborum. 164 | CityFlats Hotel 165 | 166 |
      167 |
    • 168 | 169 |
    • 170 |
      5 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 171 | Calvin College 172 |
      173 |
    • 174 | 175 |
    176 | 183 |
    184 | 185 |
    186 | 187 | 188 | -------------------------------------------------------------------------------- /jcarousellite.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jCarousel Lite - v1.9.3 - 2015-02-16 3 | * http://kswedberg.github.com/jquery-carousel-lite/ 4 | * Copyright (c) 2015 Karl Swedberg 5 | * based on the original by Ganeshji Marwaha (gmarwaha.com) 6 | * Licensed MIT (http://kswedberg.github.com/jquery-carousel-lite/blob/master/LICENSE-MIT) 7 | */ 8 | 9 | !function(a){function b(a,b){return b.autoStop&&(b.circular?b.autoStop:Math.min(a,b.autoStop))}function c(a){this.id&&(this.id+=a)}a.jCarouselLite={version:"1.9.3",curr:0},a.fn.anim="undefined"!=typeof a.fn.velocity?a.fn.velocity:a.fn.animate,a.fn.jCarouselLite=function(d){var e=a.extend(!0,{},a.fn.jCarouselLite.defaults,d),f=Math.ceil,g=Math.abs;return this.each(function(){function d(){return n.slice(p).slice(0,G)}function h(b,c){if(v)return!1;c=c||{};var f=p,g=b>p,h="undefined"!=typeof c.speed?c.speed:e.speed,i=c.offset||0;return e.beforeStart&&e.beforeStart.call(B,d(),g,c),e.circular?(b>p&&b>o-G?(b-=p,p%=E,b=p+b,C.css(w,-p*u.liSize-i)):p>b&&0>b&&(p+=E,b+=E,C.css(w,-p*u.liSize-i)),p=b+b%1):(0>b?b=0:b>o-H&&(b=o-H),p=b,0===p&&e.first&&e.first.call(this,d(),g),p===o-H&&e.last&&e.last.call(this,d(),g),e.btnPrev&&e.$btnPrev.toggleClass(e.btnDisabledClass,0===p),e.btnNext&&e.$btnNext.toggleClass(e.btnDisabledClass,p===o-H)),S(p,L),a.jCarouselLite.curr=p,f!==p||c.force?(v=!0,x[w]=-(p*u.liSize),C.anim(x,h,e.easing,function(){e.afterEnd&&e.afterEnd.call(B,d(),g,c),v=!1}),p):(e.afterEnd&&e.afterEnd.call(B,d(),g,c),p)}var i,j,k,l,m,n,o,p,q,r,s,t="ontouchend"in document,u={div:{},ul:{},li:{}},v=!1,w=e.vertical?"top":"left",x={},y=e.vertical?"height":"width",z=e.vertical?"outerHeight":"outerWidth",A=this,B=a(this),C=B.find(e.containerSelector).eq(0),D=C.children(e.itemSelector),E=D.length,F=e.visible,G=f(F),H=Math.floor(F),I=Math.min(e.start,E-1),J=1,K=0,L={},M={},N={},O=e.vertical?"y":"x",P=e.vertical?"x":"y",Q=e.init.call(this,e,D);if(Q!==!1){var R=function(){i&&i.length&&(i.remove(),j.remove()),D=C.children(e.liSelector),E=D.length,i=D.slice(E-G).clone(!0).each(c),j=D.slice(0,G).clone(!0).each(c),C.prepend(i).append(j),n=C.children(e.liSelector),o=n.length};B.data("dirjc",J),B.data(w+"jc",B.css(w)),e.circular?(R(),I+=G,K=G):(n=C.children(e.liSelector),o=n.length),e.btnGo&&e.btnGo.length&&(s=a(a.isArray(e.btnGo)&&"string"==typeof e.btnGo[0]?e.btnGo.join():e.btnGo),s.each(function(b){a(this).bind("click.jc",function(a){a.preventDefault();var c={btnGo:this,btnGoIndex:b};return h(e.circular?F+b:b,c)})}),L.go=1);var S=function(a,b){a=f(a),n.filter("."+e.activeClass).removeClass(e.activeClass),n.eq(a).addClass(e.activeClass);var c=(a-K)%E,d=c+H;return b.go&&(s.removeClass(e.activeClass).removeClass(e.visibleClass),s.eq(c).addClass(e.activeClass),s.slice(c,c+H).addClass(e.visibleClass),d>s.length&&s.slice(0,d-s.length).addClass(e.visibleClass)),b.pager&&(k.removeClass(e.activeClass),k.eq(f(c/F)).addClass(e.activeClass)),c};p=I,a.jCarouselLite.curr=p;var T=function(a){var b,c,d;return a?(u.div[y]="",u.li={width:"",height:""},u):(b=n[z](!0),c=b*o,d=b*F,u.div[y]=d+"px",u.ul[y]=c+"px",u.ul[w]=-(p*b)+"px",u.li={width:n.width(),height:n.height()},u.liSize=b,u)},U=function(b){var c,d,f={div:{visibility:"visible",position:"relative",zIndex:2,left:"0"},ul:{margin:"0",padding:"0",position:"relative",listStyleType:"none",zIndex:1},li:{overflow:e.vertical?"hidden":"visible","float":e.vertical?"none":"left"}};b&&(c=T(!0),B.css(c.div),C.css(c.ul),n.css(c.li)),c=T(),e.autoCSS&&a.extend(!0,c,f),e.autoWidth&&(d=parseInt(B.css(y),10),u.liSize=d/e.visible,c.li[y]=u.liSize-(n[z](!0)-parseInt(n.css(y),10)),c.ul[y]=u.liSize*o+"px",c.ul[w]=-(p*u.liSize)+"px",c.div[y]=d),e.autoCSS&&(n.css(c.li),C.css(c.ul),B.css(c.div))};U();var V=0,W=b(E,e),X="number"==typeof e.auto?e.auto:e.scroll,Y=function(){A.setAutoAdvance=setTimeout(function(){(!W||W>V)&&(J=B.data("dirjc"),h(p+J*X,{auto:!0}),V++,Y())},e.timeout)};if(a.each(["btnPrev","btnNext"],function(b,c){e[c]&&(e["$"+c]=a.isFunction(e[c])?e[c].call(B[0]):a(e[c]),e["$"+c].bind("click.jc",function(a){a.preventDefault();var c=0===b?p-e.scroll:p+e.scroll;return e.directional&&B.data("dirjc",b?1:-1),h(c)}))}),e.circular||(e.btnPrev&&0===I&&e.$btnPrev.addClass(e.btnDisabledClass),e.btnNext&&I+H>=o&&e.$btnNext.addClass(e.btnDisabledClass)),e.autoPager){l=f(E/F),k=[];for(var Z=0;l>Z;Z++)k.push('
  1. '+(Z+1)+"
  2. ");k.length>1&&(k=a("").appendTo(e.autoPager).find("li"),k.find("a").each(function(b){a(this).bind("click.jc",function(a){a.preventDefault();var c=b*F;return e.circular&&(c+=F),h(c)})}),L.pager=1)}S(I,L),e.mouseWheel&&B.mousewheel&&B.bind("mousewheel.jc",function(a,b){return h(b>0?p-e.scroll:p+e.scroll)}),e.pause&&e.auto&&!t&&B.bind("mouseenter.jc",function(){B.trigger("pauseCarousel.jc")}).bind("mouseleave.jc",function(){B.trigger("resumeCarousel.jc")}),e.auto&&Y(),a.jCarouselLite.vis=d,B.bind("go.jc",function(a,b,c){"undefined"==typeof b&&(b="+=1");var d="string"==typeof b&&/(\+=|-=)(\d+)/.exec(b);d?b="-="===d[1]?p-1*d[2]:p+1*d[2]:b+=I,h(b,c)}).bind("startCarousel.jc",function(){clearTimeout(A.setAutoAdvance),A.setAutoAdvance=void 0,B.trigger("go","+="+e.scroll),Y(),B.removeData("pausedjc").removeData("stoppedjc")}).bind("resumeCarousel.jc",function(a,b){if(!A.setAutoAdvance){clearTimeout(A.setAutoAdvance),A.setAutoAdvance=void 0;var c=B.data("stoppedjc");(b||!c)&&(Y(),B.removeData("pausedjc"),c&&B.removeData("stoppedjc"))}}).bind("pauseCarousel.jc",function(){clearTimeout(A.setAutoAdvance),A.setAutoAdvance=void 0,B.data("pausedjc",!0)}).bind("stopCarousel.jc",function(){clearTimeout(A.setAutoAdvance),A.setAutoAdvance=void 0,B.data("stoppedjc",!0)}).bind("refreshCarousel.jc",function(a,b){b&&e.circular&&R(),U(e.autoCSS)}).bind("endCarousel.jc",function(){A.setAutoAdvance&&(clearTimeout(A.setAutoAdvance),A.setAutoAdvance=void 0),e.btnPrev&&e.$btnPrev.addClass(e.btnDisabledClass).unbind(".jc"),e.btnNext&&e.$btnNext.addClass(e.btnDisabledClass).unbind(".jc"),e.btnGo&&a.each(e.btnGo,function(b,c){a(c).unbind(".jc")}),e.circular&&(n.slice(0,G).remove(),n.slice(-G).remove()),a.each([w+"jc","pausedjc","stoppedjc","dirjc"],function(a,b){B.removeData(b)}),B.unbind(".jc")}),r={touchstart:function(a){N.x=0,N.y=0,M.x=a.targetTouches[0].pageX,M.y=a.targetTouches[0].pageY,M[w]=parseFloat(C.css(w)),M.time=+new Date},touchmove:function(a){var b=a.targetTouches.length;1===b?(N.x=a.targetTouches[0].pageX,N.y=a.targetTouches[0].pageY,x[w]=M[w]+(N[O]-M[O]),C.css(x),e.preventTouchWindowScroll&&a.preventDefault()):(N.x=M.x,N.y=M.y)},touchend:function(){if(N.x){var a=M[O]-N[O],b=g(a),c=b>e.swipeThresholds[O],d=g(M[P]-N[P])0?"+=":"-=",j=i+e.scroll,k={force:!0};h&&c&&d?k.speed=e.speed/2:!h&&bu.liSize/2&&(j=Math.round(b/u.liSize),j=i+(j>e.visible?e.visible:j),k.offset=a),B.trigger("go.jc",[j,k]),N={}}},handle:function(a){a=a.originalEvent,r[a.type](a)}},t&&e.swipe&&B.bind("touchstart.jc touchmove.jc touchend.jc",r.handle),e.responsive&&(q=e.autoCSS,a(window).bind("resize",function(){q&&(C.width(2*C.width()),q=!1),clearTimeout(m),m=setTimeout(function(){B.trigger("refreshCarousel.jc",[!0]),q=e.autoCSS},100)}))}}),this},a.fn.jCarouselLite.defaults={containerSelector:"ul",itemSelector:"li",btnPrev:null,btnNext:null,btnGo:null,autoPager:null,btnDisabledClass:"disabled",activeClass:"active",visibleClass:"vis",mouseWheel:!1,speed:200,easing:null,timeout:4e3,auto:!1,directional:!1,autoStop:!1,pause:!0,vertical:!1,circular:!0,visible:3,start:0,scroll:1,autoCSS:!0,responsive:!1,autoWidth:!1,swipe:!0,swipeThresholds:{x:80,y:40,time:150},preventTouchWindowScroll:!0,init:function(){},first:null,last:null,beforeStart:null,afterEnd:null}}(jQuery); -------------------------------------------------------------------------------- /test/tests.js: -------------------------------------------------------------------------------- 1 | /*global module:false,test:false,equal:false,deepEqual:false,asyncTest:false,start:false */ 2 | jQuery(document).ready(function($) { 3 | 4 | module('carousels', { 5 | setup: function() { 6 | 7 | $('.slideshow').jCarouselLite({ 8 | visible: 2, 9 | speed: 2 10 | }); 11 | this.slideshow = $('div.slideshow'); 12 | this.slides = $('ul.slides'); 13 | } 14 | }); 15 | 16 | test('starting position', function() { 17 | 18 | equal($('ul.slides').eq(0).css('left'), '-800px', 'first carousel starts at correct position'); 19 | equal($('ul.slides').eq(1).css('left'), '-800px', 'second carousel starts at correct position'); 20 | }); 21 | 22 | asyncTest('go', function() { 23 | var s = this.slides; 24 | s.eq(1).trigger('go', 1); 25 | 26 | setTimeout(function() { 27 | equal(s.eq(1).css('left'), '-1200px', 'second carousel went to index 1 (2nd item)'); 28 | start(); 29 | }, 250); 30 | }); 31 | 32 | asyncTest('go to 0', function() { 33 | var s = this.slides; 34 | this.slideshow.eq(1).trigger('go', 0); 35 | 36 | setTimeout(function() { 37 | equal(s.eq(1).css('left'), '-800px', 'second carousel went back to index 0 (1st item)'); 38 | start(); 39 | }, 250); 40 | }); 41 | 42 | module('custom start and relative triggered go', { 43 | setup: function() { 44 | 45 | $('.slideshow').jCarouselLite({ 46 | start: 4, 47 | visible: 2, 48 | speed: 2 49 | }); 50 | this.slideshow = $('div.slideshow').eq(1); 51 | this.slides = $('ul.slides').eq(1); 52 | } 53 | }); 54 | 55 | test('starting position', function() { 56 | equal(this.slides.css('left'), '-2400px', 'second carousel starts at index 4 (5th item)'); 57 | }); 58 | 59 | 60 | asyncTest('go foward 2 (wrap around)', function() { 61 | var slides = this.slides; 62 | this.slideshow.trigger('go', '+=2'); 63 | 64 | setTimeout(function() { 65 | equal(slides.css('left'), '-1200px', 'second carousel advanced and wrapped around to index 1 (2nd item)'); 66 | start(); 67 | }, 750); 68 | }); 69 | 70 | asyncTest('reset and go forward 4 (wrap around)', function() { 71 | var slides = this.slides; 72 | this.slideshow.trigger('go', '+=4'); 73 | 74 | setTimeout(function() { 75 | equal(slides.css('left'), '-2000px', 'second carousel advanced and wrapped around to index 3 (4th item)'); 76 | start(); 77 | }, 750); 78 | }); 79 | 80 | module('directional option', { 81 | setup: function() { 82 | 83 | this.slideshow = $('div.slideshow'); 84 | this.slides = $('ul.slides'); 85 | 86 | this.slideshow.jCarouselLite({ 87 | auto: true, 88 | visible: 2, 89 | speed: 2, 90 | timeout: 200, 91 | directional: true, 92 | 93 | btnPrev: function() { 94 | return $(this).find('.prev'); 95 | }, 96 | btnNext: function() { 97 | return $(this).find('.next'); 98 | } 99 | }); 100 | } 101 | }); 102 | 103 | asyncTest('change directions on prevBtn click', function() { 104 | var s = this.slides; 105 | this.slideshow.eq(1).find('.prev').trigger('click'); 106 | 107 | setTimeout(function() { 108 | equal(s.eq(0).css('left'), '-800px', 'first carousel stays at initial position'); 109 | equal(s.eq(1).css('left'), '-400px', 'second carousel goes to previous slide (last slide because circular)'); 110 | 111 | }, 50); 112 | 113 | setTimeout(function() { 114 | equal(s.eq(0).css('left'), '-1200px', 'first carousel autoscrolls forward'); 115 | equal(s.eq(1).css('left'), '0px', 'second carousel autoscrolls reverse'); 116 | start(); 117 | }, 250); 118 | }); 119 | 120 | 121 | module('activeClass and visClass options', { 122 | setup: function() { 123 | this.slideshow = $('div.slideshow').eq(0); 124 | this.slides = this.slideshow.find('ul.slides'); 125 | var btns = ''; 126 | var l = this.slides.children().length; 127 | 128 | for (var i = 0; i < l; i++) { 129 | btns += '' + (i+1) + ''; 130 | } 131 | 132 | this.slideshow.append('
    ' + btns + '
    '); 133 | 134 | this.slideshow.jCarouselLite({ 135 | auto: true, 136 | circular: false, 137 | visible: 2, 138 | speed: 2, 139 | timeout: 200, 140 | directional: true, 141 | btnGo: $('a.go') 142 | }); 143 | }, 144 | teardown: function() { 145 | this.slideshow.trigger('endCarousel'); 146 | } 147 | }); 148 | 149 | asyncTest('active and vis classes correct when carousel auto-transitions', function() { 150 | var slides = this.slides; 151 | var vis = $('a.go.vis').map(function() { 152 | return $(this).index(); 153 | }).get(); 154 | 155 | equal(slides.find('li.active').index(), 0, 'first slide is initially active'); 156 | equal($('a.go.active').index(), 0, 'first "go button" is initially active'); 157 | deepEqual(vis, [0, 1], '2 "go buttons" represent initially visible items'); 158 | 159 | setTimeout(function() { 160 | equal(slides.find('li.active').index(), 1, 'second slide active after autoscrolling forward once'); 161 | equal($('a.go.active').index(), 1, 'second "go button" active after autoscrolling forward once'); 162 | vis = $('a.go.vis').map(function() { 163 | return $(this).index(); 164 | }).get(); 165 | deepEqual(vis, [1, 2], '2 "go buttons" represent initially visible items'); 166 | start(); 167 | }, 300); 168 | 169 | }); 170 | 171 | module('nav buttons', { 172 | setup: function() { 173 | this.slideshow = $('div.slideshow').eq(0); 174 | this.slides = this.slideshow.find('ul.slides'); 175 | var btns = ''; 176 | var l = this.slides.children().length; 177 | 178 | for (var i = 0; i < l; i++) { 179 | btns += '' + (i+1) + ''; 180 | } 181 | 182 | this.slideshow.append('
    ' + btns + '
    '); 183 | this.slideshow.prepend('
    '); 184 | } 185 | }); 186 | 187 | asyncTest('correct carousel position after go button clicked', function() { 188 | var s = this.slides; 189 | this.slideshow.jCarouselLite({ 190 | auto: true, 191 | visible: 2, 192 | speed: 2, 193 | timeout: 200, 194 | directional: true, 195 | btnGo: $('a.go') 196 | }); 197 | 198 | $('a.go').eq(2).triggerHandler('click'); 199 | setTimeout(function() { 200 | equal(s.css('left'), '-1600px', 'clicked on button index 2, left prop accounts for 2 prepended slides'); 201 | $('a.go').eq(1).triggerHandler('click'); 202 | setTimeout(function() { 203 | equal(s.css('left'), '-1200px', 'clicked on button index 1, left prop accounts for 2 prepended slides'); 204 | start(); 205 | }, 100); 206 | }, 100); 207 | }); 208 | 209 | asyncTest('correct carousel position after autoPager nav button clicked', function() { 210 | var pagernav = this.slideshow.find('div.pagernav'); 211 | var s = this.slides; 212 | this.slideshow.trigger('endCarousel'); 213 | this.slideshow.jCarouselLite({ 214 | auto: false, 215 | visible: 2, 216 | speed: 2, 217 | autoPager: this.slideshow.find('div.pagernav'), 218 | timeout: 200, 219 | btnGo: $('a.go') 220 | }); 221 | 222 | pagernav.find('a').eq(1).triggerHandler('click'); 223 | setTimeout(function() { 224 | equal(s.css('left'), '-1600px', 'clicked on 2nd pager, left prop accounts for 2 prepended slides'); 225 | start(); 226 | }, 100); 227 | }); 228 | 229 | 230 | 231 | }); 232 | -------------------------------------------------------------------------------- /demo/refresh.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | demo 6 | 60 | 61 | 62 | 63 | 105 | 106 | 107 |
    108 |

    "Responsive" demo

    109 |
    110 |
      111 | 112 |
    • 113 |
      1 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. 114 |
      115 |
    • 116 | 117 |
    • 118 |
      2 Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 119 | Green Roof 120 |
      121 |
    • 122 | 123 | 124 |
    • 125 |
      3 Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 126 | Zeeland 127 |
      128 |
    • 129 | 130 |
    • 131 |
      4 132 | In culpa qui officia deserunt mollit anim id est laborum. 133 | CityFlats Hotel 134 | 135 |
      136 |
    • 137 | 138 |
    • 139 |
      5 140 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 141 |
      142 |
    • 143 | 144 |
    145 | 146 | 147 |
    148 |
    149 | 150 |

    Text that will be inserted as the first slide:

    151 |
    152 | Efficiently unleash cross-media information without cross-media value. Quickly maximize timely deliverables for real-time schemas. Dramatically maintain clicks-and-mortar solutions without functional solutions. 153 |
    154 |

    And the code to do it:

    155 |
    
    156 | $('button.insert').on('click', function() {
    157 |   var curr = $.jCarouselLite.curr;
    158 |   var newSlide = '<li class="slide prepended">' +
    159 |       $('#to-prepend').html() +
    160 |       '</li>';
    161 | 
    162 |   // Insert the slide at the beginning
    163 |   $slideshow.children('ul').prepend(newSlide);
    164 | 
    165 |   // Trigger the refresh
    166 |   // with the second argument set to ['all']
    167 |   $slideshow.trigger('refreshCarousel', ['all']);
    168 |   
    169 |   // Now, since the slide was inserted *before* the current one,
    170 |   // we have to immediately adjust the carousel position
    171 |   // if we want it to remain at the same slide.
    172 |   //
    173 |   // Add 1 to the current position for the new slide,
    174 |   // and subtract 1 for *each* visible slide
    175 |   // (because the carousel is circular and
    176 |   // the plugin thus adds "padding" slides)
    177 |   
    178 |   $slideshow
    179 |   .trigger('go', [curr + 1 - 2, {speed: 0}]);
    180 | });
    181 |     
    182 |
    183 |
    184 | 185 |

    Text that will be inserted in a new slide after the first currently visible slide:

    186 |
    187 | Completely synergize resource intensive relationships via premier niche markets. Professionally cultivate one-to-one customer service with robust ideas. Dynamically innovate resource-leveling customer service for state of the art customer service. 188 |
    189 |

    And the code to do it:

    190 |
    
    191 | $('button.insert').on('click', function() {
    192 |   var curr = $.jCarouselLite.curr;
    193 |   var newSlide = '<li class="slide">' +
    194 |       $('#to-insert').html() +
    195 |       '</li>';
    196 | 
    197 |   // Insert the slide after the current slide
    198 |   $slideshow.find('li.slide').eq(curr)
    199 |   .after(newSlide);
    200 | 
    201 |   // Trigger the refresh
    202 |   // with the second argument set to ['all']
    203 |   
    204 |   $slideshow.trigger('refreshCarousel', ['all']);
    205 | });
    206 |     
    207 |
    208 |
    209 | 210 | 211 | -------------------------------------------------------------------------------- /stylesheets/stylesheet.css: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | Slate Theme for Github Pages 3 | by Jason Costello, @jsncostello 4 | *******************************************************************************/ 5 | 6 | @import url(pygment_trac.css); 7 | 8 | /******************************************************************************* 9 | MeyerWeb Reset 10 | *******************************************************************************/ 11 | 12 | html, body, div, span, applet, object, iframe, 13 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 14 | a, abbr, acronym, address, big, cite, code, 15 | del, dfn, em, img, ins, kbd, q, s, samp, 16 | small, strike, strong, sub, sup, tt, var, 17 | b, u, i, center, 18 | dl, dt, dd, ol, ul, li, 19 | fieldset, form, label, legend, 20 | table, caption, tbody, tfoot, thead, tr, th, td, 21 | article, aside, canvas, details, embed, 22 | figure, figcaption, footer, header, hgroup, 23 | menu, nav, output, ruby, section, summary, 24 | time, mark, audio, video { 25 | margin: 0; 26 | padding: 0; 27 | border: 0; 28 | font: inherit; 29 | vertical-align: baseline; 30 | } 31 | 32 | /* HTML5 display-role reset for older browsers */ 33 | article, aside, details, figcaption, figure, 34 | footer, header, hgroup, menu, nav, section { 35 | display: block; 36 | } 37 | 38 | ol, ul { 39 | list-style: none; 40 | } 41 | 42 | blockquote, q { 43 | } 44 | 45 | table { 46 | border-collapse: collapse; 47 | border-spacing: 0; 48 | } 49 | 50 | a:focus { 51 | outline: none; 52 | } 53 | 54 | /******************************************************************************* 55 | Theme Styles 56 | *******************************************************************************/ 57 | 58 | body { 59 | box-sizing: border-box; 60 | color:#373737; 61 | background: #212121; 62 | font-size: 16px; 63 | font-family: 'Myriad Pro', Calibri, Helvetica, Arial, sans-serif; 64 | line-height: 1.5; 65 | -webkit-font-smoothing: antialiased; 66 | } 67 | 68 | h1, h2, h3, h4, h5, h6 { 69 | margin: 10px 0; 70 | font-weight: 700; 71 | color:#222222; 72 | font-family: 'Lucida Grande', 'Calibri', Helvetica, Arial, sans-serif; 73 | letter-spacing: -1px; 74 | } 75 | 76 | h1 { 77 | font-size: 36px; 78 | font-weight: 700; 79 | } 80 | 81 | h2 { 82 | padding-bottom: 10px; 83 | font-size: 32px; 84 | background: url('../images/bg_hr.png') repeat-x bottom; 85 | } 86 | 87 | h3 { 88 | font-size: 24px; 89 | } 90 | 91 | h4 { 92 | font-size: 21px; 93 | } 94 | 95 | h5 { 96 | font-size: 18px; 97 | } 98 | 99 | h6 { 100 | font-size: 16px; 101 | } 102 | 103 | p { 104 | margin: 10px 0 15px 0; 105 | } 106 | 107 | footer p { 108 | color: #f2f2f2; 109 | } 110 | 111 | a { 112 | text-decoration: none; 113 | color: #007edf; 114 | text-shadow: none; 115 | 116 | transition: color 0.5s ease; 117 | transition: text-shadow 0.5s ease; 118 | -webkit-transition: color 0.5s ease; 119 | -webkit-transition: text-shadow 0.5s ease; 120 | -moz-transition: color 0.5s ease; 121 | -moz-transition: text-shadow 0.5s ease; 122 | -o-transition: color 0.5s ease; 123 | -o-transition: text-shadow 0.5s ease; 124 | -ms-transition: color 0.5s ease; 125 | -ms-transition: text-shadow 0.5s ease; 126 | } 127 | 128 | #main_content a:hover { 129 | color: #0069ba; 130 | text-shadow: #0090ff 0px 0px 2px; 131 | } 132 | 133 | footer a:hover { 134 | color: #43adff; 135 | text-shadow: #0090ff 0px 0px 2px; 136 | } 137 | 138 | em { 139 | font-style: italic; 140 | } 141 | 142 | strong { 143 | font-weight: bold; 144 | } 145 | 146 | img { 147 | position: relative; 148 | margin: 0 auto; 149 | max-width: 739px; 150 | padding: 5px; 151 | margin: 10px 0 10px 0; 152 | border: 1px solid #ebebeb; 153 | 154 | box-shadow: 0 0 5px #ebebeb; 155 | -webkit-box-shadow: 0 0 5px #ebebeb; 156 | -moz-box-shadow: 0 0 5px #ebebeb; 157 | -o-box-shadow: 0 0 5px #ebebeb; 158 | -ms-box-shadow: 0 0 5px #ebebeb; 159 | } 160 | 161 | pre, code { 162 | width: 100%; 163 | color: #222; 164 | background-color: #fff; 165 | 166 | font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace; 167 | font-size: 14px; 168 | 169 | border-radius: 2px; 170 | -moz-border-radius: 2px; 171 | -webkit-border-radius: 2px; 172 | 173 | 174 | 175 | } 176 | 177 | pre { 178 | width: 100%; 179 | padding: 10px; 180 | box-shadow: 0 0 10px rgba(0,0,0,.1); 181 | overflow: auto; 182 | } 183 | 184 | code { 185 | padding: 3px; 186 | margin: 0 3px; 187 | box-shadow: 0 0 10px rgba(0,0,0,.1); 188 | } 189 | 190 | pre code { 191 | display: block; 192 | box-shadow: none; 193 | } 194 | 195 | blockquote { 196 | color: #666; 197 | margin-bottom: 20px; 198 | padding: 0 0 0 20px; 199 | border-left: 3px solid #bbb; 200 | } 201 | 202 | ul, ol, dl { 203 | margin-bottom: 15px 204 | } 205 | 206 | ul li { 207 | list-style: inside; 208 | padding-left: 20px; 209 | } 210 | 211 | ol li { 212 | list-style: decimal inside; 213 | padding-left: 20px; 214 | } 215 | 216 | dl dt { 217 | font-weight: bold; 218 | } 219 | 220 | dl dd { 221 | padding-left: 20px; 222 | font-style: italic; 223 | } 224 | 225 | dl p { 226 | padding-left: 20px; 227 | font-style: italic; 228 | } 229 | 230 | hr { 231 | height: 1px; 232 | margin-bottom: 5px; 233 | border: none; 234 | background: url('../images/bg_hr.png') repeat-x center; 235 | } 236 | 237 | table { 238 | border: 1px solid #373737; 239 | margin-bottom: 20px; 240 | text-align: left; 241 | } 242 | 243 | th { 244 | font-family: 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, sans-serif; 245 | padding: 10px; 246 | background: #373737; 247 | color: #fff; 248 | } 249 | 250 | td { 251 | padding: 10px; 252 | border: 1px solid #373737; 253 | } 254 | 255 | form { 256 | background: #f2f2f2; 257 | padding: 20px; 258 | } 259 | 260 | img { 261 | width: 100%; 262 | max-width: 100%; 263 | } 264 | 265 | /******************************************************************************* 266 | Full-Width Styles 267 | *******************************************************************************/ 268 | 269 | .outer { 270 | width: 100%; 271 | } 272 | 273 | .inner { 274 | position: relative; 275 | max-width: 640px; 276 | padding: 20px 10px; 277 | margin: 0 auto; 278 | } 279 | 280 | #forkme_banner { 281 | display: block; 282 | position: absolute; 283 | top:0; 284 | right: 10px; 285 | z-index: 10; 286 | padding: 10px 50px 10px 10px; 287 | color: #fff; 288 | background: url('../images/blacktocat.png') #0090ff no-repeat 95% 50%; 289 | font-weight: 700; 290 | box-shadow: 0 0 10px rgba(0,0,0,.5); 291 | border-bottom-left-radius: 2px; 292 | border-bottom-right-radius: 2px; 293 | } 294 | 295 | #header_wrap { 296 | background: #212121; 297 | background: -moz-linear-gradient(top, #373737, #212121); 298 | background: -webkit-linear-gradient(top, #373737, #212121); 299 | background: -ms-linear-gradient(top, #373737, #212121); 300 | background: -o-linear-gradient(top, #373737, #212121); 301 | background: linear-gradient(top, #373737, #212121); 302 | } 303 | 304 | #header_wrap .inner { 305 | padding: 50px 10px 30px 10px; 306 | } 307 | 308 | #project_title { 309 | margin: 0; 310 | color: #fff; 311 | font-size: 42px; 312 | font-weight: 700; 313 | text-shadow: #111 0px 0px 10px; 314 | } 315 | 316 | #project_tagline { 317 | color: #fff; 318 | font-size: 24px; 319 | font-weight: 300; 320 | background: none; 321 | text-shadow: #111 0px 0px 10px; 322 | } 323 | 324 | #downloads { 325 | position: absolute; 326 | width: 210px; 327 | z-index: 10; 328 | bottom: -40px; 329 | right: 0; 330 | height: 70px; 331 | background: url('../images/icon_download.png') no-repeat 0% 90%; 332 | } 333 | 334 | .zip_download_link { 335 | display: block; 336 | float: right; 337 | width: 90px; 338 | height:70px; 339 | text-indent: -5000px; 340 | overflow: hidden; 341 | background: url(../images/sprite_download.png) no-repeat bottom left; 342 | } 343 | 344 | .tar_download_link { 345 | display: block; 346 | float: right; 347 | width: 90px; 348 | height:70px; 349 | text-indent: -5000px; 350 | overflow: hidden; 351 | background: url(../images/sprite_download.png) no-repeat bottom right; 352 | margin-left: 10px; 353 | } 354 | 355 | .zip_download_link:hover { 356 | background: url(../images/sprite_download.png) no-repeat top left; 357 | } 358 | 359 | .tar_download_link:hover { 360 | background: url(../images/sprite_download.png) no-repeat top right; 361 | } 362 | 363 | #main_content_wrap { 364 | background: #f2f2f2; 365 | border-top: 1px solid #111; 366 | border-bottom: 1px solid #111; 367 | } 368 | 369 | #main_content { 370 | padding-top: 40px; 371 | } 372 | 373 | #footer_wrap { 374 | background: #212121; 375 | } 376 | 377 | 378 | 379 | /******************************************************************************* 380 | Small Device Styles 381 | *******************************************************************************/ 382 | 383 | @media screen and (max-width: 480px) { 384 | body { 385 | font-size:14px; 386 | } 387 | 388 | #downloads { 389 | display: none; 390 | } 391 | 392 | .inner { 393 | min-width: 320px; 394 | max-width: 480px; 395 | } 396 | 397 | #project_title { 398 | font-size: 32px; 399 | } 400 | 401 | h1 { 402 | font-size: 28px; 403 | } 404 | 405 | h2 { 406 | font-size: 24px; 407 | } 408 | 409 | h3 { 410 | font-size: 21px; 411 | } 412 | 413 | h4 { 414 | font-size: 18px; 415 | } 416 | 417 | h5 { 418 | font-size: 14px; 419 | } 420 | 421 | h6 { 422 | font-size: 12px; 423 | } 424 | 425 | code, pre { 426 | min-width: 320px; 427 | max-width: 480px; 428 | font-size: 11px; 429 | } 430 | 431 | } 432 | -------------------------------------------------------------------------------- /demo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | demo 6 | 86 | 87 | 88 | 139 | 140 | 141 |
    142 |

    Instructions

    143 |

    "Responsive" demo

    144 |
    145 |

    Example using "Previous"/"Next" navigation:

    146 |
      147 |
    • 148 |
      149 | 1 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et 150 | dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex 151 | ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu 152 | fugiat nulla pariatur. 153 |
      154 |
    • 155 | 156 |
    • 157 |
      158 | 2 Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo 159 | consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla 160 | pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim 161 | id est laborum. 162 | 163 | Green Roof 164 |
      165 |
    • 166 | 167 |
    • 168 |
      169 | 3 Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est 170 | laborum. 171 | Zeeland 172 |
      173 |
    • 174 | 175 |
    • 176 |
      177 | 4 In culpa qui officia deserunt mollit anim id est laborum. 178 | CityFlats Hotel 179 |
      180 |
    • 181 | 182 |
    • 183 |
      184 | 5 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et 185 | dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex 186 | ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu 187 | fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt 188 | mollit anim id est laborum. 189 |
      190 |
    • 191 |
    192 | 193 | 194 |
    195 |

    196 | 197 | 198 |

    199 |
    200 |

    Example using numbered navigation:

    201 |
      202 |
    • 203 |
      204 | 1 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et 205 | dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex 206 | ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu 207 | fugiat nulla pariatur. 208 |
      209 |
    • 210 | 211 |
    • 212 |
      213 | 2 Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo 214 | consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla 215 | pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim 216 | id est laborum. 217 | GRCC Green Roof 218 |
      219 |
    • 220 | 221 |
    • 222 |
      223 | 3 Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est 224 | laborum. 225 | Zeeland Natatorium 226 |
      227 |
    • 228 | 229 |
    • 230 |
      231 | 4 In culpa qui officia deserunt mollit anim id est laborum. 232 | CityFlats Hotel 233 |
      234 |
    • 235 | 236 |
    • 237 |
      238 | 5 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et 239 | dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex 240 | ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu 241 | fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt 242 | mollit anim id est laborum. 243 | Calvin College 244 |
      245 |
    • 246 |
    247 | 254 |
    255 | 256 |
    257 |

    Example using custom HTML5 selectors section and article:

    258 |
    259 |
    260 |
    261 | 1 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et 262 | dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex 263 | ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu 264 | fugiat nulla pariatur. 265 |
    266 |
    267 | 268 |
    269 |
    270 | 2 Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo 271 | consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla 272 | pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim 273 | id est laborum. 274 | GRCC Green Roof 275 |
    276 |
    277 | 278 |
    279 |
    280 | 3 Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est 281 | laborum. 282 | Zeeland 283 |
    284 |
    285 | 286 |
    287 |
    288 | 4 In culpa qui officia deserunt mollit anim id est laborum. 289 | CityFlats Hotel 290 |
    291 |
    292 | 293 |
    294 |
    295 | 5 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et 296 | dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex 297 | ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu 298 | fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt 299 | mollit anim id est laborum. 300 |
    301 |
    302 |
    303 | 304 | 305 |
    306 |
    307 | 308 | 309 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # jCarouselLite 2 | 3 | By [Karl Swedberg](https://karlswedberg.com/), based on the original by [Ganeshji Marwaha](gmarwaha.com). 4 | 5 | This jQuery plugin creates a carousel-style navigation widget for images, or any content, from simple HTML markup. 6 | 7 | ## Related Projects 8 | 9 | Because jCarouselLite is relatively "light," it doesn't include a number of features that you might want for your project. 10 | Also, the responsive feature is a little hacky. If the plugin doesn't suit your needs, please consider one of the following: 11 | 12 | * [Cycle2](http://jquery.malsup.com/cycle2/) by Mike Alsup 13 | * [Slick Carousel](http://kenwheeler.github.io/slick/) by Ken Wheeler 14 | 15 | ## Installation 16 | 17 | Choose one of the following ways to put the plugin in your project: 18 | 19 | * Via bower: `bower install jquery-carousel-lite` 20 | * Via npm: `npm install jcarousellite` 21 | * Via github: Download https://github.com/kswedberg/jquery-carousel-lite/blob/master/jcarousellite.js and place it somewhere in your project 22 | * Via rawgit: Directly reference the file with `