On one page of my app I have a large heading banner with a background image ( a bit like the demo-card-header-pic example for cards ). I have set no-margin so it fills the screen width but now I want it to start from the very top of the screen and make the navbar transparent and borderless.
I want the page content to start underneath the navbar, so the effect is just a floating back button over the top of the image.
I’ve come up with something but it’s terrible because firstly it breaks in md theme, but it also glitches occasionally on ios and I’ve taken out the navbar-inner class so this must be causing some problems. But the idea is to have a slight gradient under the back button to make it visible on any image, light or dark
<div class="navbar nav-transparent no-hairline">
<div class="padding-left padding-bottom scrim-navbar">
<a href="#" class="link back text-color-white">
<i class="icon icon-back color-white"></i>
<span class="ios-only">Back</span>
</a>
</div>
</div>
<div class="page-content no-padding">
<!-- background image on a div -->
</div>
Please could you elaborate on how I would do this. I found that even setting css background : transparent !important on the navbar-inner has no affect ( I guess because of css transition occurring ).
I now see what you were saying about adding and removing the navbar-transparent class on the page events. The problem with this is that after the first page transition there and back; it starts to look glitchy because the navbar goes transparent on the previous page before transitioning out. Can you see what I mean?
pageBeforeIn: function () {
$$('.navbar').addClass('navbar-transparent no-hairline');
},
pageAfterOut: function () {
$$('.navbar').removeClass('navbar-transparent no-hairline');
},
The strange thing is, if I call console.log( $$('#page-id .navbar') ); it returns no element. Am I missing something obvious? Is the navbar removed from the Dom before rendering?
The reason it so obvious for me on the iOS theme is because my previous page is a list and when scrolled down there’s content behind the navbar. This content then flickers in sight before the page transitions on the page where I want the transparent navbar.
You likely need to set transition-duration: 400ms to navbar for iOS theme. So it is a same navbar for app pages, so it should change its background opacity for this duration to get more smooth behavior