Skip to content

Commit

Permalink
Fixed 59 - Fixed footer is anchored to the end of the page content in…
Browse files Browse the repository at this point in the history
…stead of the view port.

- If content is less than the view port height, the footer is always anchored at the bottom of the view port.
- If the content is greater in height than the view port, then in inline mode itrests in flow, and in "fixed" mode it snaps to the bottom of the view port.
  • Loading branch information
jblas committed Nov 12, 2010
1 parent 058f0a8 commit a77ca29
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions js/jquery.mobile.fixHeaderFooter.js
Expand Up @@ -130,7 +130,7 @@ $.fixedToolbars = (function(){
else{
//relval = -1 * (thisTop - (fromTop + screenHeight) + thisCSStop + thisHeight);
//if( relval > thisTop ){ relval = 0; }
relval = fromTop + screenHeight - thisHeight - thisTop;
relval = fromTop + screenHeight - thisHeight - (thisTop - thisCSStop);
return el.css('top', ( useRelative ) ? relval : fromTop + screenHeight - thisHeight );
}
}
Expand Down Expand Up @@ -164,20 +164,25 @@ $.fixedToolbars = (function(){
var $ap = $.mobile.activePage ? $.mobile.activePage : $(".ui-page-active");
return $ap.children( toolbarSelector ).each(function(){
var el = $(this);

var thisCSStop = el.css('top'); thisCSStop = thisCSStop == 'auto' ? 0 : parseFloat(thisCSStop);

//add state class
el.addClass('ui-fixed-inline').removeClass('ui-fixed-overlay');

if(immediately){
el.css('top',0);
}
else{
if( el.css('top') !== 'auto' && parseFloat(el.css('top')) !== 0 ){
var classes = 'out reverse';
el.addClass(classes).animationComplete(function(){
el.removeClass(classes);
el.css('top',0);
});
if (thisCSStop < 0 || (el.is('.ui-header-fixed') && thisCSStop != 0))
{
if(immediately){
el.css('top',0);
}
else{
if( el.css('top') !== 'auto' && parseFloat(el.css('top')) !== 0 ){
var classes = 'out reverse';
el.addClass(classes).animationComplete(function(){
el.removeClass(classes);
el.css('top',0);
});
}
}
}
});
Expand Down

0 comments on commit a77ca29

Please sign in to comment.