GithubHelp home page GithubHelp logo

codehimblog / jquery-auto-lightbox Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 2.0 1.07 MB

jQuery Plugin to automatically make image lightbox to show image with caption. You have to do nothing to set tags or classes for each image.

Home Page: http://jqueryprojects.com/jquery-auto-lightbox/

License: MIT License

JavaScript 100.00%
lightbox jquery-plugin lightweight image-viewer image-gallery

jquery-auto-lightbox's Introduction

AutoLightbox

jQuery Plugin to automatically make image lightbox to show image with caption. You have to do nothing to set tags or classes for each image.

Why Auto Lightbox

This lightweight plugin will automatically do everything for creating a simple (but not simpler) image light box to show image with caption. You have to do nothing to set tags or classes for each image. Just call:

     AutoLightbox();  
in your jQuery code, with the selector whose images to be shown in light box.

For example, if you want to show your article images, the statement will be:

   $("article").AutoLightbox(); 
Then your article must have some images, i.e:

  <article>
    ......some text.....
   <img src="/img/image-name.jpg" alt="your photo caption" />
    ......some text.....
   <img src="/img/image-name.jpg" />
    ......some text.....
   <img src="/img/image-name.jpg" />
  </article> 

What's Happen Next

When you click on the image, this plugin will clone it and show in the light box. It will auto create the lightbox container, a close button, caption bar, dim over layer (optional) and some CSS styles to look awesome. It will also automatically detect caption (from alt text), for each image.

No need any extra HTML tag, CSS code or icon as it is created with the aim to keep you in rest.
Try it, test it and don't forget to Star it on GitHub .

Advance Implementation:

By default, "Auto Lightbox" is responsive, however, if you want to change its width or height you can update its settings in jQuery code, just like below:

   $("article").AutoLightbox({
         width: 320,
         height: 240
    });  

By default, dim background effect is on, if you want to turn it off, the statement is:

   $("article").AutoLightbox({
       dimBackground: false

});

Author

A project by Asif Mughal - AutoLightbox jQuery Plugin
Visit my homepage to download or browse awesome web projects and tutorials.

jquery-auto-lightbox's People

Contributors

codehimblog avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

jameslosane deawx

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.