jquery-archive / jquery-mobile

jQuery Mobile Framework
https://jquerymobile.com
Other
9.68k stars 2.4k forks source link

footer data-position="fixed" and $.scrollTop() #2310

Closed brunob2f closed 12 years ago

brunob2f commented 13 years ago

when the window is resized by JS, the footer data-position="fixed" isn't repositionend well, so I tried to call :

if (0 < $(window).scrollTop()) {
    //affin que jquery mobile repositionne header et footer, ne pas le lancer si y'a pas de scroll, sinon ca plante jquery mobile
    $(window).scrollTop($(window).scrollTop()+1);
}

but often then the footer isn't fixed anymore.

you can try this there : http://dev.sherpa.net/fr/index.htm?b2f-force-swap-is-mobile=true#/fr/abondance/espace-magasin-fiche-1-1.html?panier=NEW&submit=OK

(the js is in http://dev.sherpa.net/js/functionMobile.js)

ahutch commented 13 years ago

I am also having this issue. When I resize the content using JS the fixed footer does not move. I have tried to force it to move using.

$(window).trigger('resize');

While this works it causes a flicker as the footer changes to inline then back to the bottom. I had not planned on using the footer but some how I cant live without it.

toddparker commented 12 years ago

We now have documented how to tell the fixed toolbars to reposition themselves and added an event that will trigger a re-position when the content length changes: http://jquerymobile.com/test/docs/toolbars/bars-fixed.html