Giter Club home page Giter Club logo

galereya's Introduction

DEPRECATED

This plugin is depricated, use CSS flexbox, CSS grid layouts (with polyfills) or other libraries instead.

Galereya

Responsive, easily customizable jquery gallery with a masonry layout. Almost all animation and effects are based on CSS features.

View Demo

Browser compatibility

Works on Chrome, Safari, Firefox, Opera(turned off some CSS animations), IE7+(Graceful degradation), Android browser, Chrome mobile, Firefox mobile, Safari on iOS and etc. Galereya effects and browser compatibility depends on your custom CSS styles a lot!

Rapid start

<head>
	<meta charset="utf-8" />
	<title>Galereya</title>
    <link href="css/jquery.galereya.css" rel="stylesheet"/>
    <!--[if lt IE 9]>
    <link rel="stylesheet" href="css/jquery.galereya.ie.css">
    <![endif]-->

    <script src="js/jquery.min.js"></script>
    <script src="js/jquery.galereya.min.js"></script>
    <script>
        $(function() {
            $('#galleryherepls').galereya();
        });
    </script>
</head>
<body>
    <div id="galleryherepls">
        <img src="path/to/thumbnail"
            alt="Title here"
            title="Or here(more priority)"
            data-desc="some description"
            data-category="image category here"
            data-fullsrc="path/to/full/image."
        />        
        ...        
        <img src="imgs/thumbnails/image42.jpg"
            alt="Image"
            data-desc="Example"
            data-fullsrc="imgs/image42.jpg"
        />
    </div>
</body>

OR

<head>
	<meta charset="utf-8" />
	<title>Galereya</title>
    <link href="css/jquery.galereya.css" rel="stylesheet"/>
    <!--[if lt IE 9]>
    <link rel="stylesheet" href="css/jquery.galereya.ie.css">
    <![endif]-->

    <script src="js/jquery.galereya.min.js"></script>
    <script>
        $(function() {
            $('#galleryherepls').galereya({
                load: function(next) {
                    $.getJSON('images.json', function(data) {
                        next(data);
                    });
                }
            });
        });
    </script>
</head>
<body>
    <div id="galleryherepls"></div>
</body>

Options

Transition durations, cells width and all other parameters, except below ones, are read from your CSS! This allows you to do a lot of different customizations for Galereya without any pain.

Options and their default values:

    $('#galleryherepls').galereya({
            //spacing between cells of the masonry grid
            spacing: 0,
            
            //waving visual effect
            wave: true,
            
            //waving visual effect timeout duration
            waveTimeout: 300,

            // special CSS modifier for the gallery
            modifier: '',
            
            //speed of the slide show
            slideShowSpeed: 10000,
            
            //speed of appearance of cells
            cellFadeInSpeed: 200,
            
            //the name of the general category
            noCategoryName: 'all',
            
            //set to true, if you don't want to show the slider on the cell click.
            disableSliderOnClick: false,
            
            //loading of images from JS. Just pass data to the callback 'next'.            
            load: function(next) {
                //Data structure example
                var data = [{"lowsrc":"upload\/thumbnails\/5165b70278e0e2.80829014.jpg","fullsrc":"upload\/5165b70278e0e2.80829014.jpg","description":"Mehmet Dere","category":"drawing"}]
                next(data);
            },

            //Cell click handler. Works even when the 'disableSliderOnClick' property is true.
            onCellClick: function(e) {}
    });

Methods

Calling example:

var gallery = $('#gal1').galereya();
gallery.openSlider(5);
Method Description
openSlider(visibleIndex) Open the slider. visibleIndex parameter is an index of a set of visible cells.
closeSlider() Yes, close it.
changeCategory(categoryName) Show a special category of images. categoryName is a name of a category.
startSlideShow() Start a slide show.
stopSlideShow() Stop a slide show.
nextSlide() Go to the next slide, if the slider is opened.
prevSlide() Go to the previous slide, if the slider is opened.
loadMore(data) Load additional images to the galereya. data is an object like in the load function.

Customization

Simple example

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.