Giter Site home page Giter Site logo

christophercaburog / blindify Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stathisg/blindify

0.0 2.0 0.0 1.97 MB

A jQuery plugin which creates a slideshow featuring a blinds effect transitioning

License: MIT License

CSS 9.02% HTML 53.30% JavaScript 37.68%

blindify's Introduction

Blindify

Blindify is a jQuery plugin which creates a slideshow featuring a blinds effect transitioning (either vertical or horizontal) between a list of images. Have a look at the demo.

blindify demo

Requirements

jQuery 1.4+

Browser support

Tested in the following browsers:

  • Google Chrome 29+
  • Mozilla Firefox 21+
  • Opera 12+
  • Microsoft Internet Explorer 9+
  • Safari 5+

Usage

First of all, you have to include Blindify's CSS file (or just copy and paste the code to one of your own), include a version of the jQuery library, and anywhere after jQuery, either the full or the minified version of Blindify. For example:

<link rel="stylesheet" href="blindify.css" media="all" />
<script type="text/javascript" src="jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="jquery.blindify.js"></script>

Afterwards, you'll need a list of images, wrapped in a container element with a unique id. For example:

<div id="blindify">
    <ul>
        <li><img src="photo_1.jpg" alt="" /></li>
        <li><img src="photo_2.jpg" alt="" /></li>
        <li><img src="photo_3.jpg" alt="" /></li>
        <li><img src="photo_4.jpg" alt="" /></li>
    </ul>
</div>

You can make the whole slideshow be a link to a specific page, by using an anchor element as the container, e.g.:

<a href="#" id="blindify">
    <ul>
        <li><img src="photo_1.jpg" alt="" /></li>
        <li><img src="photo_2.jpg" alt="" /></li>
        <li><img src="photo_3.jpg" alt="" /></li>
        <li><img src="photo_4.jpg" alt="" /></li>
    </ul>
</a>

If you wish every image to point to a unique URL, you just have to specify an option while initialising the plugin, and format your code as follows:

<div id="blindify">
    <ul>
        <li><a href="#"><img src="photo_1.jpg" alt="" /></a></li>
        <li><a href="#"><img src="photo_2.jpg" alt="" /></a></li>
        <li><a href="#"><img src="photo_3.jpg" alt="" /></a></li>
        <li><a href="#"><img src="photo_4.jpg" alt="" /></a></li>
    </ul>
</div>

Finally, to apply Blindify to your HTML code, you'll just need to initialise it and attach it to the element acting as the container, e.g.:

<script type="text/javascript">
    $(document).ready(function(){
        $('#blindify').blindify();
    });
</script>

You can override the default options of the plugin, like that:

<script type="text/javascript">
    $(document).ready(function(){
        $('#blindify').blindify({
            numberOfBlinds: 10,
            animationSpeed: 600,
            delayBetweenSlides: 200
        });
    });
</script>

You can find a list of the available options in the next section.

Configuration Options

numberOfBlinds (integer) — default: 20
The total number of blinds.

slideVisibleTime (integer) — default: 2000
Controls the time that a slide will be visible (excluding the animation time), in milliseconds (ms).

color (string) — default: '#000000'
The HEX code of the colour of the blinds.

margin (integer) — default: 2
Controls the distance between the blinds, in pixels. Note that it's the border size of each individual blind, therefore if you choose 1, the total distance is going to be 2 (one for each blind), etc.

width (integer) — default: 960
The width of the container (should be the same as the images), in pixels.

height (integer) — default: 600
The height of the container (should be the same as the images), in pixels.

gap (integer) — default: 100
The total gap of the slides from the edges of the container, in pixels. The individual gaps are calculated randomly.

animationSpeed (integer) — default: 100
Controls the speed of the animation that opens/closes the blinds, in milliseconds (ms).

delayBetweenSlides (integer) — default: 500
Controls a small delay between animating the blinds to their open state, in milliseconds (ms).

hasLinks (boolean) — default: false
Set to true, when there are individual links for every image.

orientation (string) — default: 'vertical'
The orientation of the blinds; it can be either vertical or horizontal.

startClosed (boolean) — default: false
Set to true to start with the blinds closed.

firstOpenDelay (integer) — default: 500
Controls the delay before the blinds are opened for the first time, when startClosed is set to true; in milliseconds (ms).

blindify's People

Contributors

stathisg avatar

Watchers

James Cloos avatar Christopher Caburog avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.