Git Product home page Git Product logo

photopopup's Introduction

Photo PopUp

javaScript and CSS responsive Photo / image viewer window and gallery.

Demo

Demo website or CodePen (Full page),

While theme (version 1.1)

Comparison

Photo PopUp 1.3.1 PhotoSwipe 4.1.1 FancyBox 1.3.4 Yoxigen 2.21 Clearbox 3.7
JavaScript size 12.6 KB 25 KB (only core.js) 27.9 KB 39.6 KB 16.1 KB (only cb_core.js)
Using jQuery No No Yes Yes Yes
Responsive (resized window) Yes Yes No Yes No
Mobile view Good Good Good Good Good
Keyboard control Yes Yes Yes Yes No
Touch gesture control Yes Yes No No No
Easy basic configuration Yes Yes Yes Yes Yes
Custom events Yes Yes Yes No No
Custom buttons, functions Yes No No No No
HTML5 fullscreen Yes, with addon Yes No No No
Image zoom Not yet Yes No No No
Image preload in gallery Yes Yes No No No
Fade animation Yes No Yes Yes Yes
Text window Yes No Yes Yes Yes
summary 13/14 10/14 6/14 6/14 4/14

Using

First step

  1. Load script.js and style.css or script_min.js and style_min.css
  2. Add website the contents of the photopopop.html file

Gallery

  • Use the newgallery function, with this parameter:
    • HTML image tags className
imagepopup.newGallery('imagagesClassName');

More about Gallery

Image

  • Use the showimage function, with this parameter:
    • First parameter: Image URL
    • Second parameter: Image title
    • third parameter: Gallery class name (see more: using_test.html and using_test.js)
imagepopup.showImage('http://test.hu/image.jpg');
imagepopup.showImage('http://test.hu/image.jpg','This is an image.');

Text

  • Use the showtext function, with this parameter:
    • First parameter: Title
    • Second parameter: Full text
imagepopup.showText('Header','Text');
imagepopup.showText('Header',document.getElementById('szovpop').innerHTML);

Hide window

  • Use the hideimage function
imagepopup.hideImage();

Add custom button

See this example

  • Use the addbutton function, with this parameter:
    • First parameter: Title, button text
    • Second parameter: function, that runs when clicked on the button
imagepopup.addbutton('alert button',function(){alert('alert');});

Add custom events

See this example

  • Use the addevent function, with this parameter:
    • First parameter: onopen / onclose / onbuttonclick
    • Second parameter: function
      • a onopen return url and title, onclose return 'prev' or 'next'
imagepopup.addevent('onopen',function(url,title){alert('Open image ('+url+')');});

Options

  • Edit option object in script

used

photopopup's People

Contributors

vmarci21 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

photopopup's Issues

Option object

Edit simply default text, theme, and config functions.

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.