Skip to content
프로젝트

소개

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

디자인 및 미디어

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

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.

Multiple sliders on the same page
$('.ba-slider').each(function(){
     $(this).beforeAfter();
});
Use with Drupal Behaviors
(function ($, Drupal) { 
Drupal.behaviors.pronatura_image_comparison = { 
  attach: function (context, settings) {        
    $('.ba-slider').each(function(){            
      $(this).beforeAfter();                    
    });                 
  }                     
};                      
})(jQuery, Drupal); 

LICENSE

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

관련 프로젝트 살펴보기

불러오는 중…