In this tutorial we will figure out how to create a responsive image gallery with a thumbnail carousel. The gallery will adjust to the size of the viewport, and you can also disable or enable the thumbnail carousel. Navigation can be done using the keyboard.

We'll be using the jQuery Touchwipe plugin so that navigation can be done using typical screen manipulations on iPhone and iPad.

HTML markup

In the HTML code we will use the main container with the class “rg-gallery”. It will also have the same identifier as the class. Another div element with the class “rg-thumbs” will house the structure for the Elastislide carousel:

Previous Next

The thumbnails will have two data attributes which will be used later in our JavaScript code. The “data-large” attribute contains the path to the large image, and the “data-description” attribute contains the caption that will be displayed under the current large image.

For the structure of the large image viewport, we use a jQuery template, which is added in the head of our document:

((if itemsCount > 1)) Previous image Next image ((/if))

We are adding a condition that the navigation will only be displayed if there is more than one image. The “rg-image” container will be used to add a large image.

CSS

In addition to setting a few parameters (for example, margins and padding for thumbnails in the Elastislide carousel), you need to set styles for the rest of the gallery elements.

The “rg-image-wrapper” element that is used in the jQuery template will have relative positioning and a semi-transparent repeating image as the background. The frame will have rounded corners and a minimum height of 20 px:

Rg-image-wrapper( position:relative; padding:20px 30px; background:transparent url(../images/black.png) repeat top left; -moz-border-radius: 10px; -webkit-border-radius: 10px ; border-radius: 10px; min-height:20px; )

The container that is used to add a large image will have a relative position and a line height of 0. By adding a center text alignment to it, we will force all inline elements to center align. But since we are not using “display:block” for the image, we need to set the line height to 0. This way there will be no space above the image since it is a default inline element:

Rg-image( position:relative; text-align:center; line-height:0px; )

By setting the large image's max-width property to 100%, we ensure that it always remains surrounded by a floating container. We don't need this property, but if you want to limit the size of the preview area, then you will have to set a fixed height for the “rg-image” class and the image will fill it as the viewport width changes.

Rg-image img( max-height:100%; max-width:100%; )

Navigation elements will have the following styles:

Rg-image-nav a( position:absolute; top:0px; left:0px; background:#000 url(../images/nav.png) no-repeat -20% 50%; width:28px; height:100 %; text-indent:-9000px; cursor:pointer; opacity:0.3; outline:none; -moz-border-radius: 10px 0px 0px 10px; -webkit-border-radius: 10px 0px 0px 10px; border-radius: 10px 0px 0px 10px; )

This is the style for the left arrow, now let's look at the properties for the right arrow:

Rg-image-nav a.rg-image-nav-next( right:0px; left:auto; background-position:115% 50%; -moz-border-radius: 0px 10px 10px 0px; -webkit-border-radius : 0px 10px 10px 0px; border-radius: 0px 10px 10px 0px; )

Since we have already defined the value of the left property for elements in general, we will have to set it to auto for the right arrow.

The arrows will become clearer when you hover your mouse over them:

Rg-image-nav a:hover( opacity:0.8; )

Captions will have the following styles:

Rg-caption ( text-align:center; margin-top:15px; position:relative; ) .rg-caption p( font-size:11px; letter-spacing:2px; font-family: "Trebuchet MS", "Myriad Pro", Arial, sans-serif; line-height:16px; padding:0 15px; text-transform:uppercase; )

Set the following styles for the switch:

Rg-view( height:30px; ) .rg-view a( display:block; float:right; width:16px; height:16px; margin-right:3px; background:#464646 url(../images/views. png) no-repeat top left; border:3px solid #464646; opacity:0.8; ) .rg-view a:hover( opacity:1.0; ) .rg-view a.rg-view-full( background-position:0px 0px; ) .rg-view a.rg-view-selected( background-color:#6f6f6f; border-color:#6f6f6f; ) .rg-view a.rg-view-thumbs( background-position:0px -16px; )

A loading indicator will appear in the center of the image:

Rg-loading( width:46px; height:46px; position:absolute; top:50%; left:50%; background:#000 url(../images/ajax-loader.gif) no-repeat center center; margin :-23px 0px 0px -23px; z-index:100; -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px; opacity:0.7; )

JavaScript

The main idea of ​​the gallery is its flexibility. The problem was partially solved using styles: large image fits the container. To get a responsive thumbnail carousel, we use the Elastislide plugin.

Let's define some variables:

// Gallery container var $rgGallery = $("#rg-gallery"), // Carousel container $esCarousel = $rgGallery.find("div.es-carousel-wrapper"), // Carousel item $items = $esCarousel .find("ul > li"), // Total number of items itemsCount = $items.length;

Then the gallery function:

Gallery = (function() ( //Gallery function ))(); Gallery.init();

Here we define variables for the current image, output mode and control over loading of the image. Then we call several functions, which are defined below:

// Index of the current item var current = 0, // Mode: carousel || full screen mode = "carousel", // Check if one image is loaded anim = false, init = function() ( // (Optional) preload images here... $items.add(" ").imagesLoaded(function() ( // Add options _addViewModes(); // Add a wrapper for the large image _addImageWrapper(); // Display the first image _showImage($items.eq(current)); )); // Initialize the carousel _initCarousel(); ),

Call the Elastislide plugin:

InitCarousel = function() ( // Use the elastislide plugin: $esCarousel.show().elastislide(( imageW: 65, onClick: function($item) ( if(anim) return false; anim = true; // On keypress mouse, display the image _showImage($item); // Change the current current = $item.index(); ) ); // Set the current for elastislide $esCarousel.elastislide("setCurrent", current); ),

Next function displays and controls view mode switches:

AddViewModes = function() ( // Top right buttons: hide / show carousel var $viewfull = $(""), $viewthumbs = $(""); $rgGallery.prepend($("").append($viewfull ).append($viewthumbs)); $viewfull.bind("click.rgGallery", function(event) ( $esCarousel.elastislide("destroy").hide(); $viewfull.addClass("rg-view-selected "); $viewthumbs.removeClass("rg-view-selected"); mode = "fullview"; return false; )); $viewthumbs.bind("click.rgGallery", function(event) ( _initCarousel(); $ viewthumbs.addClass("rg-view-selected"); $viewfull.removeClass("rg-view-selected"); mode = "carousel"; return false; )); ),

The _addImageWrapper function adds a structure for a large image and a navigation button if the total number of images is more than one. Navigation events are also fired. Using the jQuery Touchwipe plugin we add support for navigation using touch screen and keyboards:

AddImageWrapper= function() ( // Add structure for large images and navigation buttons (if total number of items > 1) $("#img-wrapper-tmpl").tmpl((itemsCount: itemsCount)).appendTo($rgGallery) ; if(itemsCount > 1) ( // Add navigation var $navPrev = $rgGallery.find("a.rg-image-nav-prev"), $navNext = $rgGallery.find("a.rg-image-nav -next"), $imgWrapper = $rgGallery.find("div.rg-image"); $navPrev.bind("click.rgGallery", function(event) ( _navigate("left"); return false; )) ; $navNext.bind("click.rgGallery", function(event) ( _navigate("right"); return false; )); // Add a touchwipe event to wrap the large image $imgWrapper.touchwipe(( wipeLeft: function() ( _navigate("right"); ), wipeRight: function() ( _navigate("left"); ), preventDefaultEvents: false )); $(document).bind("keyup.rgGallery", function(event) ( if (event.keyCode == 39) _navigate("right"); else if (event.keyCode == 37) _navigate("left"); )); ) ),

Navigation through large images is controlled by the following function:

Navigate = function(dir) ( // Navigation through large images if(anim) return false; anim = true; if(dir === "right") ( if(current + 1 >= itemsCount) current = 0; else + +current; ) else if(dir === "left") ( if(current - 1< 0) current = itemsCount - 1; else --current; } _showImage($items.eq(current)); },

Depending on the direction of movement, we set the current element.

The _showImage function adds a large image and its title:

ShowImage = function($item) ( // Display a large image that is associated with $item var $loader = $rgGallery.find("div.rg-loading").show(); $items.removeClass("selected") ; $item.addClass("selected"); var $thumb = $item.find("img"), largesrc = $thumb.data("large"), title = $thumb.data("description"); $ (" ").load(function() ( $rgGallery.find("div.rg-image").empty().append(" "); if(title) $rgGallery.find("div.rg-caption").show().children("p").empty().text(title); $loader.hide(); if( mode === "carousel") ( $esCarousel.elastislide("reload"); $esCarousel.elastislide("setCurrent", current); ) anim = false; )).attr("src", largesrc); ); return(init:init);

I spent a long time choosing the topic for today’s topic. As a result, I noticed that we have not yet made collections with image galleries. In my opinion, it’s an excellent topic, since many sites have galleries. Frankly, they are all not very attractive. Considering the current development trends of jquery, html5, etc., I thought that there must be much more attractive solutions than those that I had encountered before. So. After spending a day, we managed to find a huge number of scripts. From this whole mountain, I decided to select only, because I love, as you already noticed from previous posts.
The image gallery is applicable not only in the case of photo albums. The script can be used, I think it would be even more correct, as a portfolio for photographers, designers, etc. Jquery effects will help attract the attention of visitors and simply add elegance to your site.
So. For your attention jquery collection image gallery plugins for the site.
Don’t forget to comment and remember, so as not to lose this collection, you can add it to your favorites by clicking on the star at the bottom of the article.

PHOTOBOXFree, easy, responsive gallery images, in which all effects and transitions are made using css3. Ideal for creating a photographer's portfolio website.

S Gallery An attractive Jquery image gallery plugin. The animation works using css3.

DIAMONDS.JSOriginal plugin for creating an image gallery. The miniatures are shaped like a diamond, which is this moment very popular. This form is made using css3. The only negative of this gallery is the absence of a lightbox in which the photo would open in full size. That is, you will need to screw in the lightbox plugin. This script generates an adaptive grid of images in the shape of a diamond.

Superbox A modern image gallery using Jquery, css3 and html5. We are all used to the fact that when you click on a preview, the full image opens in a lightbox (pop-up window). The developers of this plugin decided that the lightbox had already outlived its usefulness. The images in this gallery open below the preview. Watch the demo and see that this solution looks much more modern.
| Smooth Diagonal Fade Gallery A modern image gallery in which previews are distributed across the entire screen space. The script can scan a folder with photos on the server, that is, you do not need to insert each image separately. Just upload the pictures to a folder on the server and specify the path to the directory in the settings. Then the script will do everything itself.

Gamma Gallery A stylish, lightweight, responsive image gallery with a Pinterest-style grid that has become very popular these days. The script works perfectly on both desktop computers and mobile devices with any screen resolution. Perfect solution to create a web designer portfolio.

THUMBNAIL GRID WITH EXPANDING PREVIEWThe plugin is a responsive image grid. When you click below, a larger photo and description will appear. Good for creating a portfolio.

jGalleryjGallery is a full-screen, responsive image gallery. Effects, transitions and even style are easily customizable.

Glisse.js A simple but very effective image gallery plugin. This is exactly the solution when you need to create a photo album. The plugin supports albums and has a very cool flipping effect.

Mosaic Flow A simple, responsive image gallery with a Pinterest-style grid.

GalereyaAnother stylish gallery with a Pinterest-style grid filtered by category. Works in browsers: Chrome, Safari, Firefox, Opera, IE7+, Android browser, Chrome mobile, Firefox mobile.

least.jsGreat free image gallery using JQUERY, 5 and CSS3. She has a very attractive appearance and will undoubtedly attract the attention of your visitors.

flipLightBox A simple image gallery. When you click on the preview, the full image opens in a lightbox.

blueimp GalleryFlexible gallery. Capable of outputting to modal window not only images, but also videos. Works great on touch devices. It is easy to customize and it is possible to expand the functionality using additional plugins (See the next plugin).

Image galleries and sliders are some of the most popular jQuery formats. Thanks to them, you can add the necessary amount of visual content to your site, while saving valuable space.

Galleries and sliders make the page less busy, but still allow you to add all the images you need to convey your message. They will be especially useful for online stores.

In today's article, we have collected the best jQuery image galleries and sliders for you.

To install them, just add the selected plugins to the head section HTML pages along with the jQuery library and configure them according to the documentation (just a couple of lines of code).

Choose which of these elements fits perfectly into your project.

1. Bootstrap Slider

Bootstrap Slider - free, optimized for mobile devices Image slider with touch and swipe scrolling. It will look amazing on any screen and in any browser. You can load images, videos, text, thumbnails, and buttons into sliders.

2. Product Preview Slider

Product Preview Slider embodies the full potential of jQuery and fits perfectly into any interface. You will also be pleased with the quality and cleanliness of the code of this plugin.

3. Expandable Image Gallery

Expandable Image Gallery is an amazing plugin that turns into a full-screen gallery with one click. It can be used for the “About Us” section or to view product information.

4. Fotorama

Fotorama is a responsive jQuery gallery plugin that works for both desktop and desktop. mobile browsers. It offers a variety of navigation options: thumbnails, scrolling, forward and back buttons, automatic slideshows, and bullets.

5. Immersive Slider

Immersive Slider allows you to create a unique slide viewing experience similar to the Google TV slider. You can change background image, which will be blurred to maintain focus on the main photos.

6. Leastjs

Leastjs - responsive jQuery plugin, which will help you create an amazing gallery. When you hover the cursor over the image, text appears; when you click, the window expands to full screen.

7. Sliding Panels Template

This plugin is ideal for a portfolio. It will create blocks of images arranged horizontally (vertically on small screens) to which the selected content will be linked.

8. Squeezebox Portfolio Template

Squeezebox Portfolio Template offers motion effects for your portfolio. When you hover over the main image (or block), anchored elements appear.

9. Shuffle Images

Shuffle Images is an amazing responsive plugin that allows you to create a gallery with images that change on hover.

10. Free jQuery Lightbox Plugin

Free jQuery Lightbox Plugin will help you show one or more images on one page. They can also be enlarged and returned to their original size.

11. PgwSlider – Responsive slider for jQuery

PgwSlider is a minimalistic image slider. jQuery code is light, so the loading speed of this plugin will pleasantly surprise you.

12. Scattered Polaroids Gallery

Scattered Polaroid Gallery is a stunning slider made in flat design. Its elements move chaotically when switching images, which looks amazing.

13. Bouncy Content Filter

Bouncy Content Filter is an ideal solution for portfolios. This plugin allows users to quickly move from one category to another.

14. Simple jQuery Slider

Simple jQuery Slider lives up to its name. This plugin combines elements of JavaScript, HTML5 and CSS3. The default demo only allows text to be loaded, but if you make a few changes you can add visual content as well.

15. Glide JS

Glide JS is a simple, fast and responsive jQuery slider. It is easy to configure, and the plugin does not take up much space.

16. Fullscreen drag-slider with parallax

This amazing jQuery slider with the ability to load images and text is suitable for any site. It will delight users with a slight parallax effect and slow text appearance.

Today we'll look at the jQuery Flipping Gallery plugin, which allows you to create cool image galleries with very original transitions. In the example there are 5 types of transitions using this plugin. The plugin is really very easy to use, so anyone can fully use it.

An example can be seen here:

Download

We'll look in more detail at how to create a menu from Demo 2, with the menu appearing in the top left.

HTML part

First you need to connect the jQuery library, which you can download here, and the Flipping Gallery plugin, between the tags:

1 2 3 4 5 6 ... ...

Then we arrange the images. You can add as many images as you like:

1 2 3 4 5 6 7 8 ...

And to add a description for images (as in demos 4 and 5) you need to use the attribute data-caption:

1 2 3 4 5 6 7 8 ...
JS part
1 2 3 4 5 6 7 8 9 $(".gallery") .flipping_gallery (( direction: "forward" , selector: "> a" , spacing: 10 , showMaximum: 15 , enableScroll: true , flipDirection: "bottom" , autoplay: 500 ) ) ;

Let's look at what each method means:

  • direction - method responsible for how images will appear. If “forward”, then the image from the beginning will be placed at the end, if “backward” - vice versa. The default value is “forward”.
  • selector - selector by which we select images; it can be changed as desired.
  • spacing — sets the spacing between images in perspective.
  • showMaximum - sets the number of images that are visible to the user. You can use at least 100 images, but only the first 15 will be shown, which is very convenient and does not load the browser.
  • enableScroll - you can view images using the mouse wheel.
  • flipDirection - determines where the image will slide: “left” - left, “right” - right, “top” - up and “bottom” - down. By default it slides down.
  • autoplay — gallery autoplay. Specified in milliseconds, i.e. How long will it take for the images to change?
Conclusion

You now have a stunning gallery to use when posting your photos.

Hi all! In this article we will look at how to make a beautiful and conveniently sortable gallery using JQuery.

A beautiful, conveniently sorted gallery is a wonderful thing for your website that will delight you and your visitors. Today we will look at a very easy to install and configure plugin for the JQuery library – Filterizr.

Despite the ease of use, the plugin is quite lightweight and effective. Let's take a closer look at it.

Demonstration

To see how the plugin works, go to the official website, and here it is in front of you!

You can choose to sort by city, nature, industry, sunrise, sunset or show all photos (default). There is a Shuffle button that will allow you to shuffle the images. The ASC and DESC buttons sort pictures in ascending and descending order, respectively. If you want to find an image by position or description, select the desired item in the drop-down list and enter the query in the search field. When you hover your mouse over the image, the picture turns from black and white to color.

Installation

To download the library, click the Download button or use NPM:

Npm install filterizr

The plugin is already configured out of the box, but if you want to override the defaults you can either:

1) Pass an object with parameters to the JQuery constructor

Var filterizd = $(".filtr-container").filterizr((
// options
})

2) Rewrite the options using the setOptions() method on the Filterizr object.

Filterizd.filterizr("setOptions", (
// options
})

Options

Default parameters:

Options = (
animationDuration: 0.5,
callbacks: (
onFilteringStart: function() ( ),
onFilteringEnd: function() ( )
},
delay: 0,
delayMode: "progressive",
easing: "ease-out",
filter: "all",
filterOutCss: (
opacity: 0,
transform: "scale(0.5)"
},
filterInCss: (
opacity: 0,
transform: "scale(1)"
},
layout: "sameSize",
selector: ".filtr-container",
setupControls: true
}

More detailed instructions and a description of each parameter can be found at