SeanBlakeley / minimit-gallery

Javascript plugin to create complex interactions

Home Page:http://www.minimit.com/projects/code/minimit-gallery-plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

minimit-gallery

Minimit Gallery is a custom slider plugin. It supports drags, scrollers, touch interactions, hash and pushstate links.

It is a library agnostic javascript plugin, built for advanced frontend developers, who wants to spend less time coding the logic, and more time coding the animations.

It’s very customizable, but you have to code the animation, all the css, and some of the logic of the slider. To understand how to use this plugin see the 2.0 guide and the demo page.

Browser support

IE7+, Firefox 3.5+, Safari 3+, Opera 9+, Chrome, Iphone, Ipad, Android, Windows Phone.

Guide

My website minimit.com and my twitter.

Alert

This is still an experimental plugin, with an API subject to change in the future. If you have new ideas how to make the code simpler and with fewer settings, please drop me a line.

Usage

<!-- specify the html items -->
<div id="reference-item-0">0</div>
<div id="reference-item-1">1</div>
<div id="reference-item-2">2</div>
<div id="reference-item-3">3</div>
<div id="reference-item-4">4</div>
<div id="reference-item-5">5</div>

<!-- include mg Javascript code -->
<script type="text/javascript" src="mg.min.js"></script>

<script type="text/javascript">
// construct gallery
var mgObject = new Mg({
    reference:"reference",
    click:{
        activated:[0],
        cycle:true,
        interactive:true,
        maxActivated:1,
        auto:1000, autoSlow:5000
    }
});

// specify gallery click event function
mgObject.click.onEvent = function(){
    document.getElementById("#"+this.reference+"-item-"+this.deactivated).className = '';
    document.getElementById("#"+this.reference+"-item-"+this.activated).className = 'active';
}

// init the gallery
mgObject.init();
</script>

Acknowledgements

Copyright © 2013 Riccardo Caroli. Licensed under MIT license.

About

Javascript plugin to create complex interactions

http://www.minimit.com/projects/code/minimit-gallery-plugin