I read the next example
And I'm trying to create an example of switching pages with slide, when the current page slides left I wont that next slide with it (like scroller).
Here is my code:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" type="text/css" href="css/animations.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<style>
html{
margin: 0;
padding: 0;
border: 0;
width: 100%;
height: 100%;
}
#wrapper{
background-color: #000000;
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
}
.page{
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
visibility: hidden;
overflow: hidden;
backface-visibility: hidden;
}
.current{
visibility: visible;
z-index: 1;
}
</style>
<script>
$(document).ready(function(){
$("#p12").click(function(){
$("#page1").addClass("pt-page-moveToLeft");
//$("#page2").addClass("current");
//$("#page2").addClass("pt-page-moveFromLeft");
//$("#page1").removeClass("current");
});
});
$(".page").on('transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd',
function() {
alert("finished");
});
</script>
</head>
<body>
<div id="wrapper">
<div id="page1" class="page current" style="background-color: #FF9999;">
<h1>page1</h1>
<button id="p12">next</button>
</div>
<div id="page2" class="page" style="background-color: #00ff00;">
<h1>page2</h1>
</div>
<div id="page3" class="page" style="background-color: #0000ff;">
<h1>page3</h1>
</div>
</div>
</body>
</html>
How can I synchronize the 2 transitions pt-page-moveToLeft
and pt-page-moveFromLeft
?
Note: I found this but it's also doesn't work for me
EDIT:
See the jsFiddle
EDIT (2):
Sorry for my English, I meant that I wont to support features like go from page 1 to 3 without go through 2 or use other transitions.