Skip to content

Commit

Permalink
Fix animation hovering with odd page count
Browse files Browse the repository at this point in the history
  • Loading branch information
Zlobin committed Feb 13, 2015
1 parent d47cc29 commit 0283142
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.2
2.4.3
6 changes: 6 additions & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ <h3>Page 8</h3>
Aliquam eget hendrerit augue, quis ultricies risus. Donec lobortis, erat eget convallis elementum, nunc turpis consectetur ipsum, non vehicula velit neque quis libero. Vestibulum ullamcorper augue nulla, sed vehicula neque fermentum eu. Morbi egestas dignissim urna, ut gravida ligula bibendum eu. Etiam rhoncus, justo vel ultricies dictum, elit felis ornare erat, vitae accumsan neque massa eu quam. Sed facilisis mauris ut diam elementum, quis pulvinar eros molestie. Duis lobortis ullamcorper consequat. Donec tellus lectus, blandit eu ultrices nec, feugiat ac tellus. Mauris eleifend dolor a arcu sodales porta. Proin pharetra posuere volutpat.
</p>
</div>
<div>
<h3>Page 9</h3>
<p>
Aliquam eget hendrerit augue, quis ultricies risus. Donec lobortis, erat eget convallis elementum, nunc turpis consectetur ipsum, non vehicula velit neque quis libero. Vestibulum ullamcorper augue nulla, sed vehicula neque fermentum eu. Morbi egestas dignissim urna, ut gravida ligula bibendum eu. Etiam rhoncus, justo vel ultricies dictum, elit felis ornare erat, vitae accumsan neque massa eu quam. Sed facilisis mauris ut diam elementum, quis pulvinar eros molestie. Duis lobortis ullamcorper consequat. Donec tellus lectus, blandit eu ultrices nec, feugiat ac tellus. Mauris eleifend dolor a arcu sodales porta. Proin pharetra posuere volutpat.
</p>
</div>
</div>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion jBooklet.jquery.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"book",
"booklet"
],
"version": "2.4.2",
"version": "2.4.3",
"author": {
"name": "Eugene Zlobin"
},
Expand Down
2 changes: 1 addition & 1 deletion src/jquery.jbooklet.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
*
* Version : 2.4.2
* Version : 2.4.3
*
* Originally based on the work of:
* 1) Charles Mangin (http://clickheredammit.com/pageflip/)
Expand Down
6 changes: 3 additions & 3 deletions src/jquery.jbooklet.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
*
* Version : 2.4.2
* Version : 2.4.3
*
* Originally based on the work of:
* 1) Charles Mangin (http://clickheredammit.com/pageflip/)
Expand Down Expand Up @@ -971,7 +971,7 @@

if (options.hovers || options.manual) {
if (inc) {
if (!isBusy && !isHoveringRight && !isHoveringLeft && !p3drag && options.currentIndex + 2 <= options.pageTotal - 2) {
if (!isBusy && !isHoveringRight && !isHoveringLeft && !p3drag && options.currentIndex + 2 <= options.pageTotal - 1) {
p2.stop().animate(anim.hover.p2, anim.hover.speed, options.easing);
p3.addClass('b-grab');
p3.stop().animate(anim.hover.p3, anim.hover.speed, options.easing);
Expand Down Expand Up @@ -999,7 +999,7 @@
endHoverAnimation = function (inc) {
if (options.hovers || options.manual) {
if (inc) {
if (!isBusy && isHoveringRight && !p3drag && options.currentIndex + 2 <= options.pageTotal - 2) {
if (!isBusy && isHoveringRight && !p3drag && options.currentIndex + 2 <= options.pageTotal - 1) {
p2.stop().animate(anim.hover.p2end, anim.hover.speed, options.easing);
p3.stop().animate(anim.hover.p3end, anim.hover.speed, options.easing);
p3wrap.stop().animate(anim.hover.p3wrapEnd, anim.hover.speed, options.easing);
Expand Down

0 comments on commit 0283142

Please sign in to comment.