ionNavView Conditional animation class


#1

I want to ‘slide-left-right’ animation on iOS App but not on Android app. I want to run android without animation.

For iOS;

<ion-nav-view name="menuContent" animation="slide-left-right"></ion-nav-view>

For Android;

<ion-nav-view name="menuContent" animation="no-animate"></ion-nav-view>

Can I run the app with conditional animation?


#2

that s what i m trying to get as well… android bothers me a lot


#3

did you have any success so far?


#4

Unfortunately we didn’t. But you can add some code into the ionic.js but it’s not a right way as we did :/. We solve that situation by adding index.html;

var isIos = true;

then in ionic.js;

if (window.isIos) { ...do something... }

But as I said that is not a good solution. Ionic must be do something about this. We need conditional view.


#5

Thanks for the answer. I have added attributes conditionally depending on the OS.

<script>
    var noAnimation = ionic.Platform.is('android'),
    body = document.getElementById("bd"),
    navbar = document.getElementById("nb");

    if(noAnimation) {
        body.setAttribute('animation', 'no-animation');
        navbar.setAttribute('animation', 'no-animation');
    }
</script>