Skip to content

Commit

Permalink
Merge pull request #33 from nnattawat/setreverse
Browse files Browse the repository at this point in the history
Merging set reverse branch
  • Loading branch information
JemarJones committed Jul 16, 2015
2 parents 05ce077 + b073e5c commit a165d16
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 25 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# jQuery Flip <sub><sup>v1.0.12</sup></sub>
# jQuery Flip <sub><sup>v1.0.13</sup></sub>

**A lightweight jQuery plugin to create 3d flip animation.**
See the [project page](http://nnattawat.github.io/flip/)

## What's new
* **Flip v1.0.13**
* [Added ability to change 'reverse' dynamically](https://github.com/nnattawat/flip/commit/a047b24569abd3e5357255a6b143781f91356af0)

* **Flip v1.0.12**
* [v1.0.11 Not working in Firefox](https://github.com/nnattawat/flip/issues/28)
* [Simplified callback](https://github.com/download/flip/commit/f3378c7513ea086623b01b1bfb16706731ee8a1b)
Expand Down Expand Up @@ -40,15 +43,15 @@ See the [project page](http://nnattawat.github.io/flip/)
## Getting Started

### CDN
https://cdn.rawgit.com/nnattawat/flip/v1.0.12/dist/jquery.flip.min.js
https://cdn.rawgit.com/nnattawat/flip/v1.0.13/dist/jquery.flip.min.js

### Download
* [jquery.flip.js][max] (development version, commented ~9kB)
* [jquery.flip.min.js][min] (production version, minified ~4kB, gzipped ~2kB)
* [jquery.flip.min.js.map][map] (source map, ~5kB)
[max]: https://cdn.rawgit.com/nnattawat/flip/v1.0.12/dist/jquery.flip.js
[min]: https://cdn.rawgit.com/nnattawat/flip/v1.0.12/dist/jquery.flip.min.js
[map]: https://cdn.rawgit.com/nnattawat/flip/v1.0.12/dist/jquery.flip.min.js.map
[max]: https://cdn.rawgit.com/nnattawat/flip/v1.0.13/dist/jquery.flip.js
[min]: https://cdn.rawgit.com/nnattawat/flip/v1.0.13/dist/jquery.flip.min.js
[map]: https://cdn.rawgit.com/nnattawat/flip/v1.0.13/dist/jquery.flip.min.js.map

### Bower
<pre>bower install flip</pre>
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flip",
"version": "1.0.12",
"version": "1.0.13",
"dependencies": {},
"devDependencies": {
"jquery": "~2.1.1"
Expand Down
25 changes: 17 additions & 8 deletions dist/jquery.flip.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! flip - v1.0.12 - 2015-07-14
/*! flip - v1.0.13 - 2015-07-16
* https://github.com/nnattawat/flip
* Copyright (c) 2015 Nattawat Nonsung; Licensed MIT */
(function( $ ) {
Expand Down Expand Up @@ -184,28 +184,37 @@
}
}else{
//The element has been initiated, all we have to do is change applicable settings
if (options.axis !== undefined){
setAxis.call(this,options.axis,callback);
if (options.axis !== undefined || options.reverse !== undefined){
changeSettings.call(this,options,callback);
}
}
});

return this;
};
var setAxis = function(axis,callback){
if ($(this).data("axis") != axis.toLowerCase()){
var changeSettings = function(options,callback){
var changeNeeded = false;
if (options.axis !== undefined && $(this).data("axis") != options.axis.toLowerCase()){
$(this).data("axis", options.axis.toLowerCase());
changeNeeded = true;
}
if (options.reverse !== undefined && $(this).data("reverse") != options.reverse){
$(this).data("reverse", options.reverse);
changeNeeded = true;
}
if (changeNeeded){
var faces = $(this).find($(this).data("front")).add($(this).data("back"), $(this));
var savedTrans = faces.css("transition");
faces.css({
transition: "none"
});
//Only setting the axis if it needs to be

axis = axis.toLowerCase();
$(this).data("axis", axis);
//options.axis = options.axis.toLowerCase();
//$(this).data("axis", options.axis);

//This sets up the first flip in the new direction automatically
var rotateAxis = "rotate" + axis;
var rotateAxis = "rotate" + $(this).data("axis");
if ($(this).data("flipped")){
$(this).find($(this).data("front")).css({
transform: rotateAxis + ($(this).data("reverse") ? "(-180deg)" : "(180deg)"),
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.flip.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/jquery.flip.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flip",
"version": "1.0.12",
"version": "1.0.13",
"description": "jQuery Plugin - 3d Flip Content",
"keywords": [
"jquery-plugin"
Expand Down
Loading

0 comments on commit a165d16

Please sign in to comment.