0
抱歉沒有提供小提琴,我不能讓它在那裏設置。jQuery的移動彈出不關閉
但是,我使用以下代碼以編程方式打開和關閉彈出窗口。只是它不關閉並保持打開狀態。我究竟做錯了什麼?
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.js"></script>
<script>
$(document).ready(function()
{
$("#initialpopup").popup("open");
setTimeout(function()
{
$("#initialpopup").popup("close");
}, 500);
});
</script>
</head>
<body>
<div data-role="page" data-theme="a" data-content-theme="c">
<div data-role="popup" id="initialpopup" data-overlay-theme="a" data-theme="a">Foobar</div>
</div>
</body>
</html>
你要在5秒後自動關閉呢? – CR41G14 2013-03-04 16:52:13
可能的重複:http://stackoverflow.com/questions/13154278/in-jquery-mobile-why-doesnt-this-popup-close – WildCrustacean 2013-03-04 16:55:16
500毫秒後。超時標誌着ajax調用的完整回調處理程序。 – 2013-03-04 16:59:54