I have a view where I need to implement a sticky menu inside of the Ionic framework.
Looking for an Angular not jQuery solution I found ngSticky. Great library works perfect, the problem however is that it won't work inside of the Ionic directive <ion-content>
.
I asked a previous question about it here, and then figured out what was going on:
Because the parent container that ion-content
creates has the following style on it:
<div class="scroll" style="transform: translate3d(0px, 0px, 0px) scale(1);">
It's a fix for an iPad scrolling bug as described here.
So I can't remove that style and removing it would involve making changes to the core ionic.bundle.js
file anyways.
The only thing I can think of now at the moment, is to write some code to detect when the sticky header hits the top, then remove that block of HTML out of ion-content
and replace it above the ion-content
container.
Is there any other way around this?
Here is a Plunker http://plnkr.co/edit/DiVfOzjJevSFOtVitYty?p=preview There is a jQuery hack in place that removes the style tag so you can see how it should work.