mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-27 01:24:41 +00:00
changed setTop logic so it works for abs or rel positioning for both headers and footers (rather than just footers)
This commit is contained in:
parent
ab0e3324e9
commit
0de4e457be
1 changed files with 2 additions and 8 deletions
|
|
@ -88,16 +88,10 @@ $.fixedToolbars = (function(){
|
|||
screenHeight = window.innerHeight,
|
||||
thisHeight = el.outerHeight();
|
||||
if( el.is('.ui-header-fixed') ){
|
||||
return el.css('top', fromTop - thisTop + thisCSStop);
|
||||
return el.css('top', (el.parents('.ui-page').length) ? fromTop - thisTop + thisCSStop : fromTop);
|
||||
}
|
||||
else{
|
||||
//check if the footer is relative positioned or not
|
||||
if( el.parents('.ui-page').length ){
|
||||
return el.css('top', -1 * (thisTop - (fromTop + screenHeight) + thisCSStop + thisHeight) );
|
||||
}
|
||||
else{
|
||||
return el.css('top', fromTop + screenHeight - thisHeight );
|
||||
}
|
||||
return el.css('top', (el.parents('.ui-page').length) ? -1 * (thisTop - (fromTop + screenHeight) + thisCSStop + thisHeight) : fromTop + screenHeight - thisHeight );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue