Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html JQuery移动弹出对话框闪烁并重新定位到错误的位置_Html_Jquery Mobile_Popup_Flicker - Fatal编程技术网

Html JQuery移动弹出对话框闪烁并重新定位到错误的位置

Html JQuery移动弹出对话框闪烁并重新定位到错误的位置,html,jquery-mobile,popup,flicker,Html,Jquery Mobile,Popup,Flicker,在我的html中,我有下面的链接来显示弹出对话框 <h2 class="modest-size-chart"> <a data-role="none" data-rel="popup" href="#sample_length_size_chart_popup" class="btn_size_chart">Size Chart</a> </h2> <div data-role="popup" id="sample_length_si

在我的html中,我有下面的链接来显示弹出对话框

<h2 class="modest-size-chart">
    <a data-role="none" data-rel="popup" href="#sample_length_size_chart_popup" class="btn_size_chart">Size Chart</a>
</h2>
<div data-role="popup" id="sample_length_size_chart_popup" data-overlay-theme="b">
    ...
</div>

...
单击页面中的“尺寸图表”后,显示id为“样本长度尺寸图表弹出”的弹出对话框。对话框的默认位置位于移动屏幕的中心

当向上/向下滚动页面时,弹出窗口将与页面一起向上/向下移动。这是意料之中的

但是,有时(尤其是弹出对话框被隐藏并再次显示),弹出对话框将闪烁并重新定位在屏幕中心


我不想重新定位,它应该在与页面相关的相同位置。有什么建议吗?

将弹出位置设置为相对于特定元素,添加:

data-position-to="#fixedElement"

。这样,弹出窗口应始终在
#fixedElement
附近打开。您必须使用一个
:可见的
元素,根据您的需要定位。

因此,它应该与“data position to=“origin”一起工作,对吗?但是运气不好。不,
origin
,我想它会将弹出窗口放置在windowcenterthx,供您发表评论。我已经试过你的建议了,还是不走运。我认为
data position to=“”
只适用于初始位置。但问题是,在滚动过程中,弹出对话框将闪烁并重新定位在屏幕中央。同样,基于这个问题,我认为可能会有一些事件调用弹出对话框来呈现自己。但请参阅手册,对于弹出对话框,只有3个事件:PopupBeforeLocation、popupafteropen和popupafterclose。它们都不会调用其渲染。有什么想法吗?你试过使用API方法吗?