Is it possible to set custom page transition in routes.js if it is a computer?

I would like to set a custom page transition to fade for all routes, but only if it is on a computer and use the default if it is on a mobile or tablet.

Can this be done in the routes or do I have to do it on every router.navigate? Like this.

if (app.device.desktop){
 mainView.router.navigate("/shop/", {ignoreCache: true, force:true, transition:'f7-fade'});
}else{
mainView.router.navigate("/shop/", {ignoreCache: true, force:true});
}

Thanks.

var app = new Framework7({
  view:{
    transition: Framework7.device.desktop ? 'f7-fade' : null
  }
});
2 Likes

Thanks a lot plpl, works great :slight_smile: