jQuery的移动弹出窗口无法正常工作?

问题描述:

im使用jquery mobile.我试图创建一个弹出窗口.我发现此Simpel代码应能正常工作. http://jquerymobile.com/branches/popup-widget/docs /pages/popup/index.html

im using jquery mobile. im trying to create a popup. I found this simpel code that should work. http://jquerymobile.com/branches/popup-widget/docs/pages/popup/index.html

我尝试了示例中的代码

<a href="#popupBasic" data-rel="popup">Tooltip</a>

<div data-role="popup" id="popupBasic">
    This is a completely basic popup, no options set.
</div>

但是当我将其放入自己的代码中时,div仍会显示,并且当我单击按钮时,它会转到另一页,而不是弹出窗口.有人可以帮我吗?

but when I put this in my own code the div will still display and when I click on the button it goes to an other page, instead of a popup. Can someone help me?

嗯...我已经使它工作了(下面的示例代码,对于字符串混乱不清,我无法在代码块中显示它否则)...但我想知道您是如何找到此页面的??这似乎不是最新的jQuery Mobile版本候选对象的一部分...所以我想这对您不起作用,因为您的JS和CSS引用未指向实际包含相应代码的文件?>

Well ... I've gotten it to work (sample code below, sorry for the muddled string I couldn't get it to display in the code blocks otherwise) ... but I'm wondering how YOU found this page?? This doesn't seem to be part of the latest jQuery Mobile release candidate ... so my guess is that it's not working for you because your JS and CSS references aren't pointing to the files that actually contain the corresponding code?

<!DOCTYPE html>
<html class="ui-mobile-rendering">
    <head>
        <meta charset="utf-8"/>
        <meta name="viewport" content="width=device-width, initial-scale=1"/>
        <title>JQM popup test</title>
        <link rel="stylesheet"
            href="http://jquerymobile.com/branches/popup-widget/css/themes/default/jquery.mobile.css"/>
        <script src="http://jquerymobile.com/branches/popup-widget/js/jquery.js"></script>
        <script src="http://jquerymobile.com/branches/popup-widget/js/"></script>
    </head>
    <body>
        <a href="#popupBasic" data-rel="popup">Tooltip</a>
        <div data-role="popup" id="popupBasic">This is a completely basic popup, no options set.</div>
        <div>Other</div>
        <div>Random</div>
        <div>Text</div>
    </body>
</html>