jquery mobile slide reverse transition shows blank page in middle of transition
Asked Answered
W

1

5

For some reason, on the ipad, my jquery mobile slide transitions between pages works perfectly when it's a default swipe left [slide]. But when it's a swipe right [slide reverse], there seems to be a full empty white page in between pages during the transition.

<div data-role="page" id="zine1">
   <div data-role="content">    
              VARIOUS HTML CONTENT
   </div><!-- /content -->
</div>
<div data-role="page" id="zine2">
   <div data-role="content">    
              VARIOUS HTML CONTENT
   </div><!-- /content -->
</div>
<div data-role="page" id="zine3">
   <div data-role="content">    
              VARIOUS HTML CONTENT
   </div><!-- /content -->
</div>
<script>
   $(document).ready(function() {
        window.now = 1;

        //get an Array of all of the pages and count
        windowMax = $('div[data-role="page"]').length; 

        doBind();
    });
    // Functions for binding swipe events to named handlers
    function doBind() {
        $('div[data-role="page"]').live("swipeleft", turnPage); 
        $('div[data-role="page"]').live("swiperight", turnPageBack);
    }

    function doUnbind() {
        $('div[data-role="page"]').die("swipeleft", turnPage);
        $('div[data-role="page"]').die("swiperight", turnPageBack);
    }

    // Named handlers for binding page turn controls
    function turnPage(){
        // Check to see if we are already at the highest numbers page            
        if (window.now < windowMax) {
            window.now++
            $.mobile.changePage("#zine"+window.now, {transition:"slide"});
        }
    }

    function turnPageBack(){
        // Check to see if we are already at the lowest numbered page
        if (window.now != 1) {
            window.now--;
            $.mobile.changePage("#zine"+window.now, {transition:"reverse slide"});
        }
    }
</script>
Wist answered 17/5, 2012 at 1:50 Comment(0)
D
11

transition:"reverse slide" seems deprecated. Try data-direction="reverse".

Debroahdebs answered 31/5, 2012 at 18:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.