Skip to content

Commit

Permalink
update lib to support jquery3 #63
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael Eidus committed Jun 8, 2017
1 parent 7618849 commit 83e625d
Show file tree
Hide file tree
Showing 3 changed files with 367 additions and 366 deletions.
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -3,7 +3,7 @@
Include the javascript and css files.

```html
<script src="js/jquery-2.1.0.min.js" type="text/javascript"></script>
<script src="js/jquery-3.2.1.min.js" type="text/javascript"></script>
<script src="js/jquery.event.move.js" type="text/javascript"></script>
<script src="js/jquery.twentytwenty.js" type="text/javascript"></script>
<link rel="stylesheet" href="css/twentytwenty.css" type="text/css" media="screen" />
Expand All @@ -25,7 +25,7 @@ After including the files you are ready to create a container that holds two ima
Now initialize the plugin on the window load:

```
$(window).load(function(){
$(function(){
$("#container1").twentytwenty();
});
```
Expand All @@ -34,7 +34,7 @@ $(window).load(function(){


```js
$(window).load(function(){
$(function(){
$(".twentytwenty-container").twentytwenty({
default_offset_pct: 0.7, // How much of the before image is visible when the page loads
orientation: 'vertical', // Orientation of the before and after images ('horizontal' or 'vertical')
Expand Down Expand Up @@ -62,7 +62,7 @@ If you want to avoid a [FOUC](http://en.wikipedia.org/wiki/Flash_of_unstyled_con
If you want to use multiple instances of this plugin on a single page you can target the container class:

```js
$(window).load(function(){
$(function(){
$(".twentytwenty-container").twentytwenty();
});
```
Expand Down
11 changes: 7 additions & 4 deletions index.html
Expand Up @@ -26,7 +26,7 @@ <h3>Basic Usage</h3>
</div>
</div>
</div>

<div class="row" style="margin-top: 2em; margin-bottom: 2em;">
<div class="large-4 columns">
<h3>Vertical Orientation</h3>
Expand Down Expand Up @@ -58,12 +58,15 @@ <h3>Side by side</h3>
</div>
</div>
</div>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>

<script
src="https://code.jquery.com/jquery-3.2.1.js"
integrity="sha256-DZAnKJ/6XZ9si04Hgrsxu/8s717jcIzLy3oi35EouyE="
crossorigin="anonymous"></script>
<script src="js/jquery.event.move.js"></script>
<script src="js/jquery.twentytwenty.js"></script>
<script>
$(window).load(function(){
$(function(){
$(".twentytwenty-container[data-orientation!='vertical']").twentytwenty({default_offset_pct: 0.7});
$(".twentytwenty-container[data-orientation='vertical']").twentytwenty({default_offset_pct: 0.3, orientation: 'vertical'});
});
Expand Down

0 comments on commit 83e625d

Please sign in to comment.