Page Transitions and Adding a Back Button with WordPress Pages

If you are display a WordPress page, and you want a page transition when a link is clicked, add a class of 'push-page' to the link.

This will cause the page to have a back button.

<a href="http://mysite.com/page" class="push-page">Click here</a>

To add a link that gets rid of a stack of pages with back buttons, use the class .app-root-page. This is useful on the WooCommerce order confirmation page, so that your app user doesn't have to click back a bunch of times.

<a href="http://mysite.com/page" class="app-root-page">Click here</a>

Sample JavaScript for opening URLs in your AppPresser app.

<!-- open a link in the system browser -->
<a href="#" onclick="systemlink()">System Link</a>

<script>
function systemlink(){

var url = 'http://mylink.com/';
var options = 'location=yes';
var target = '_system';
var message = { iablink: url, options: options, target: target };
parent.postMessage( JSON.stringify(message), '*');

}
</script>


<!-- open an iframed transition page -->
<script>
var message = { url: 'http://mylink.com/', title: 'My Page' };
parent.postMessage( JSON.stringify(message), '*');
</script>


<!-- open an iframe page -->
<script>
var url = 'http://mylink.com/';
var target = '_self';
var options = 'location=yes';
var message = { apppage: {url: url, options: options, target: target }};
parent.postMessage( JSON.stringify(message), '*');
</script>