Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery-mobile sliding menu under header

I just entered into jQuery mobile, and saw the next example

Is it possible to make the sliding menu appear under the header? (in the red lines in the image)

enter image description here

like image 983
NickF Avatar asked Dec 06 '22 07:12

NickF


1 Answers

Override .ui-panel style by changing top position and min-height values

Demo

Calculate header's .outerHeight() and panel's .height().

var header = $('[data-role=header]').outerHeight(); 
var panel = $('.ui-panel').height();

Give panel a new min-height in order not to cause page to scroll

var panelheight = panel - header;

Override panel style

$('.ui-panel').css({
    'top': header,
    'min-height': panelheight
});
like image 185
Omar Avatar answered Dec 29 '22 10:12

Omar