Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/80.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
Javascript jQuery移动弹出窗口未关闭_Javascript_Jquery_Jquery Mobile_Popup - Fatal编程技术网

Javascript jQuery移动弹出窗口未关闭

Javascript jQuery移动弹出窗口未关闭,javascript,jquery,jquery-mobile,popup,Javascript,Jquery,Jquery Mobile,Popup,对不起,没有提供小提琴,我无法在那里安装 但是,我使用以下代码以编程方式打开和关闭弹出窗口。只是它不关,而且一直开着。我做错了什么 <!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:/

对不起,没有提供小提琴,我无法在那里安装

但是,我使用以下代码以编程方式打开和关闭弹出窗口。只是它不关,而且一直开着。我做错了什么

<!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>

$(文档).ready(函数()
{
$(#initialpopup”).popup(“打开”);
setTimeout(函数()
{
$(#initialpopup”).popup(“关闭”);
}, 500);    
});
福巴
您可以试试

$('#initialpopup').popup('open', {transition: 'pop'});
window.setTimeout('$("#initialpopup").popup("close");', 500);

是否要在5秒后自动关闭?可能重复:500毫秒后。超时标志着ajax调用的完整回调处理程序。这会有什么不同?使用eval'd字符串而不是lambda函数是否有意义?