├── README.md ├── css └── craftyslide.css ├── demo.html ├── images └── pagination.png ├── js ├── craftyslide.js └── craftyslide.min.js └── license.txt /README.md: -------------------------------------------------------------------------------- 1 | Craftyslide - A tiny jQuery slideshow plugin 2 | ============================================ 3 | 4 | About 5 | ----- 6 | 7 | Craftyslide is a tiny (just 2kb) slideshow built on jQuery. Craftyslide aims to be different, by providing a simple, no-frills method of displaying images; packaged into a small, clean and efficient plugin. 8 | 9 | Usage 10 | ----- 11 | 12 | HTML 13 | 14 |
" + $caption + "
"); 52 | } 53 | $slides.filter(":first").find(".caption").css("bottom", 0); 54 | }); 55 | } 56 | 57 | // Manual mode 58 | function manual() { 59 | var $pagination = $("#pagination li a"); 60 | $pagination.click(function (e) { 61 | e.preventDefault(); 62 | var $current = $(this.hash); 63 | if ($current.is(":hidden")) { 64 | $slides.fadeOut(options.fadetime); 65 | $current.fadeIn(options.fadetime); 66 | $pagination.removeClass("active"); 67 | $(this).addClass("active"); 68 | $(".caption").css("bottom", "-37px"); 69 | $current.find(".caption").delay(300).animate({ 70 | bottom: 0 71 | }, 300); 72 | } 73 | }); 74 | } 75 | 76 | // Auto mode 77 | function auto() { 78 | setInterval(function () { 79 | $slides.filter(":first-child").fadeOut(options.fadetime).next("li").fadeIn(options.fadetime).end().appendTo("#slideshow ul"); 80 | 81 | $slides.each(function () { 82 | if ($slides.is(":visible")) { 83 | $(".caption").css("bottom", "-37px"); 84 | $(this).find(".caption").delay(300).animate({ 85 | bottom: 0 86 | }, 300); 87 | } 88 | }); 89 | 90 | }, options.delay); 91 | } 92 | 93 | // Width 94 | $this.width(options.width); 95 | $this.find("ul, li img").width(options.width); 96 | 97 | // Height 98 | $this.height(options.height); 99 | $this.find("ul, li").height(options.height); 100 | 101 | // Check Boolean values 102 | if (options.pagination === true) { 103 | paginate(); 104 | } else { 105 | auto(); 106 | } 107 | 108 | captions(); manual(); 109 | 110 | }); 111 | }; 112 | })(jQuery); -------------------------------------------------------------------------------- /js/craftyslide.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Craftyslide 3 | * Created by: Abid Din - http://craftedpixelz.co.uk 4 | * Version: 1.0 5 | * Copyright: Crafted Pixelz 6 | * License: MIT license 7 | * Updated: 7th June 2011 8 | */ 9 | 10 | (function($){$.fn.craftyslide=function(options){var defaults={"width":600,"height":300,"pagination":true,"fadetime":350,"delay":5000};var options=$.extend(defaults,options);return this.each(function(){var $this=$(this);var $slides=$this.find("ul li");$slides.not(':first').hide();function paginate(){$this.append(""+$caption+"
");}$slides.filter(":first").find(".caption").css("bottom",0);});}function manual(){var $pagination=$("#pagination li a");$pagination.click(function(e){e.preventDefault();var $current=$(this.hash);if($current.is(":hidden")){$slides.fadeOut(options.fadetime);$current.fadeIn(options.fadetime);$pagination.removeClass("active");$(this).addClass("active");$(".caption").css("bottom","-37px");$current.find(".caption").delay(300).animate({bottom:0},300);}});}function auto(){setInterval(function(){$slides.filter(":first-child").fadeOut(options.fadetime).next("li").fadeIn(options.fadetime).end().appendTo("#slideshow ul");$slides.each(function(){if($slides.is(":visible")){$(".caption").css("bottom","-37px");$(this).find(".caption").delay(300).animate({bottom:0},300);}});},options.delay);}$this.width(options.width);$this.find("ul, li img").width(options.width);$this.height(options.height);$this.find("ul, li").height(options.height);if(options.pagination===true){paginate();}else{auto();}captions();manual();});};})(jQuery); -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2011 Crafted Pixelz, http://craftedpixelz.co.uk 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. --------------------------------------------------------------------------------