Giter Site home page Giter Site logo

sethsandaru / js-image-splitter-view Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 0.0 5.31 MB

JS Library to create an Image Splitter UI View

Home Page: https://sethphat.com/js-image-splitter-view/demo/

License: MIT License

JavaScript 100.00%
js library image view image-compare image-splitter-view web-ui ui-design ui-component

js-image-splitter-view's Introduction

js-image-splitter-view

Simple JS/JQuery Library to create an Image Splitter View. Best use-case is for Compare Products/Images/... Website :D

Demo (demo file is in the demo folder of this repository):
Hehe

Online Demo: https://sethphat.com/js-image-splitter-view/demo/

Version: 1.0.0

Dependencies

  • JQuery
  • JQuery UI

Note: you must include both JQuery and JQuery UI in order to use this library.

Usage

Include those files in dist to your project, then:

<link rel="stylesheet" href="css/image.splitter.view.css" />
<script src="js/jquery.image.splitter.view.js"></script>

Preparation

You need prepare this HTML structure before initialize the UI View:

    <div class="splitter-container" id="splitterContainer">
        <div>
            <img class="img-responsive" src="img1.png">
        </div>
        <div>
            <img class="img-responsive" src="img2.png">
        </div>
    </div>

Initialize

<script>
	$(document).ready(function() {
		$("#splitterContainer").imageSplitter();
	});
</script>

Result:
Result Default

Available Colors for Splitter Control

  • .is-primary
  • .is-success
  • .is-info
  • .is-warning
  • .is-danger

You need to add it like this:

<div class="splitter-container is-primary" id="splitterContainer">

Result:
Splitter Control Image

Important Note

  • You have to make sure both of your images is full-width and have a same width & height. Otherwise it will break.

Copyright & Supporting the project

If you really like this project & want to contribute a little for the development. You can buy me a coffee. Thank you very much for your supporting ♥.

Buy Me A Coffee

Copyright © 2018 by Seth Phat aka Phat Tran Minh!

js-image-splitter-view's People

Contributors

phatsandaru avatar sethsandaru avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.