Offset top of fixed element is 0 on android 4.2.1

241 views Asked by At

I'm using Bootstrap Affix to fix an element to the top of the window when it's scrolled past.

However in the android stock browser will calculate el.offset().top relative to the window instead of the body. Which causes the Affix pluggin to change the class to affix-top instead of affix.

Is there another way to calculate the elements position relative to the body?

The css I use is a simple:

.affix {
    position: fixed;
    top: 0;
}
0

There are 0 answers