Has anyone successfully got a sticky footer to work with an Ionic setup?
Seems to be a bit tricky with the way it works
Any examples or ideas would be greatly appreciated
Has anyone successfully got a sticky footer to work with an Ionic setup?
Seems to be a bit tricky with the way it works
Any examples or ideas would be greatly appreciated
Not sure what you mean about a sticky footer, but this will render a footerbar
ion-pane
ion-header-bar
ion-content
ion-footer-bar
(donât mind the jade syntax)
Thanks man for replying.
Sticky footer as in something like this : http://ryanfait.com/sticky-footer/
On a small screen the footer would be at the bottom of the page, but on a bigger screen the footer would be âfixedâ to the bottom.
The only way I can see doing it as of right now is a timeout and do a bit of math against the translate3d position. It wouldnât be a good fix though, in fact it would be horrible
If you put an ion-footer-bar out side of the ion-content, it stays on the bottom of the screen.
Just a bit different.
Take my link for example : http://ryanfait.com/sticky-footer/
On a desktop browser, the footer is visible at the bottom of the screen.
Now, if you shrink the browser height to say 500px, the footer is âmade hiddenâ but if you scroll the page down, the footer is still there.
On a large screen, the footer is locked to the bottom of the screen.
On a smaller screen, the footer sits below the content
Ahh I see.
Yeah with the way our scrolling works this wonât be possible.
Plus, native apps donât really do this either. Footers tend to be fixed at the bottom and always visible.
Here it is (I guess⌠I hope).
@mhartington - I agree, itâs not a usual native thing
@xAlien95 - I was hoping to refrain from a javascript solution, not sure but it might be a little too painful for older Android devices. Your solution seems to work fine in the browser, Iâll have to give it a shot. Thanks
@xAlien95 Thanks for the codepen! I havenât tested performance on a device yet, but Iâll go with this solution.
An important side note: I just spent a lot of time hunting a bug in your code, since the footer often only came up partially. It turned out that your second translate3d line omits the px. This is the correct way:
footer.style[ionic.CSS.TRANSFORM] = 'translate3d(0,' + reverse + 'px, 0)'
For some reason I am getting the following error when I implement this solution:
Uncaught TypeError: Cannot read property âscrollTopâ of undefined
Any ideas?