0

Hi im using jquery mobile 1.2.0 and using popups. i need to show a popup in my jquery mobile page which contains a listview but when the popup is show i can scroll it down while for example the header is in fixed position. i tried

$("#pushNotificationExample").bind({
 popupafteropen: function(event, ui) {
  $("#pushNotificationExample").css({position:'fixed', top:0}); }
});

but no luck. is there another way to do this?

4

1 回答 1

2

下面将弹出窗口定位在页面的顶部和中心。

演示

$('#popupMenu').on('popupafteropen', function () {
 var center = ($(document).width() - $('.ui-popup-container').width()) / 2;
 $('.ui-popup-container').css({
   top: 0,
     left: center
 });  
});
于 2013-04-29T16:40:25.667 回答