现在,当我召唤一个弹出窗口时,它会出现在标题上,然后向下滑动。看看它现在的样子。如何使Jquery Mobile中的标题下的弹出式滑块向下滑动
我想弹出从标题下方滑落。我试着设置弹出窗口的z索引低于标题,但它没有做任何事情。显然你需要明确地设置元素的位置来使用z索引,但是当我这样做时,它完全搞砸了UI。
下面是相关的代码
HTML:
<div data-role="popup" id="alertPopup" class="ui-content" data-shadow="false" data-transition="slidedown" data-dismissible="false" data-corners="false" data-position-to="origin">
<p id="popupText"></p>
</div>
JS:
var horizontal = Math.floor(window.innerWidth/2);
var vertical = 80;
var popupOptions = {
x: horizontal,
y: vertical
};
if (status == google.maps.DirectionsStatus.ZERO_RESULTS) {
$("#popupText").text("No transit options could be found.");//using popups instead of alerts because these will go away by themselves instead of forcing user to tap.
$("#alertPopup").popup("open",popupOptions);
setTimeout(function() {
$("#alertPopup").popup("close");
}, 3000);
}
http://jsfiddle.net/guanzo/gvsqenvf/
请创建的jsfiddle或代码段。 – 2014-10-29 05:05:07
http://jsfiddle.net/guanzo/gvsqenvf/ – 2014-10-29 05:40:35