before-after.js

An Image Comparision Slider: See an example demo here: http://www.jotform.com/formscentral/

  • Owner: jotform/before-after.js
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

before-after.js

A simple and responsive image comparison slider

Comparison sliders are nothing new. There are even pure CSS implementations that is nothing but short of amazing. However, I wasn’t able to find a truly responsive one that was simple enough for our needs. This gave me the chance (and excuse) to build one myself that can be used anywhere.

The Medium article details each decision made along the way.

DEMO

Image comparison

UPDATES

  • Performance improvements (Feb, 2017)
  • before-after is now a jquery plugin, special thanks to @ramblex. Also CDN links updated and fixed a few issues.(Feb, 2016)
  • I was finally able to remove the jQuery Mobile dependency and handle it with native events. If you wish to help, mobile testing is much appreciated since I can only test a limited number devices. (March, 2015)

DEPENDENCIES

USAGE

$('.ba-slider').beforeAfter();

Or you can simply copy the contents of the sample.html to your own page. All links are called from a CDN.

LICENSE

The MIT License (MIT)
Copyright (c) 2015 JotForm

Main metrics

Overview
Name With Ownerjotform/before-after.js
Primary LanguageJavaScript
Program languageCSS (Language Count: 3)
Platform
License:MIT License
所有者活动
Created At2015-03-06 08:39:44
Pushed At2023-03-15 08:08:42
Last Commit At2022-03-17 15:45:05
Release Count0
用户参与
Stargazers Count360
Watchers Count46
Fork Count63
Commits Count51
Has Issues Enabled
Issues Count13
Issue Open Count8
Pull Requests Count6
Pull Requests Open Count3
Pull Requests Close Count2
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private