localhost/wor/ru/2019/02/09/page1/page2
localhost/wor/ru/2019/02/09/page1
<main id="barba-wrapper" aria-live="polite">
<?php
$next_post = get_next_post();
if( ! empty($next_post) ){
$next_post_link = get_permalink( $next_post );
?>
<a class="nav next next_post_link" href="<?php echo $next_post_link ?>">Next</a>
<?php
}
?>
<?php
$prev_post = get_previous_post();
if( ! empty($prev_post) ){
$prev_post_link = get_permalink( $prev_post );
?>
<a class="nav prev prev_post_link" href="<?php echo $prev_post_link; ?>">Prev</a>
<?php
}
?>
<div class=" barba-container" data-prev="<?php echo basename($prev_post_link); ?>" data-next="<?php echo basename($next_post_link);?>" style="visibility: visible;">
<!-- code html ....-->
</div>
</main>
var next, prev;
$('.prev_post_link').on('click', function(e){
next = -100;
prev = 100;
})
$('.next_post_link').on('click', function(e){
next = 100;
prev = -100;
})
TweenLite.set(this.newContainer, {
visibility: 'visible',
xPercent: goingForward ? next : -100,
position: 'fixed',
left: 0,
right: 0
});
TweenLite.to(this.oldContainer, 11, { xPercent: goingForward ? prev : 100 });
TweenLite.to(this.newContainer, 11, { xPercent: 0, onComplete: function() {
TweenLite.set(_this.newContainer, { clearProps: 'all' });