jquery 移动弹出窗口不起作用? [英] jquery mobile popup not working?

查看:30
本文介绍了jquery 移动弹出窗口不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 jquery mobile.我正在尝试创建一个弹出窗口.我发现这个简单的代码应该可以工作.http://jquerymobile.com/branches/popup-widget/docs/pages/popup/index.html

我尝试了示例中的代码

工具提示<div data-role="popup" id="popupBasic">这是一个完全基本的弹出窗口,没有设置选项.

但是当我把它放在我自己的代码中时,div 仍然会显示,当我点击按钮时,它会转到另一个页面,而不是弹出窗口.有人可以帮我吗?

解决方案

嗯……我已经开始工作了(下面的示例代码,抱歉我无法在代码块中显示混乱的字符串否则)...但我想知道你是如何找到这个页面的??这似乎不是最新的 jQuery Mobile 候选版本的一部分......所以我的猜测是它不适合你,因为你的 JS 和 CSS 引用没有指向实际包含相应代码的文件?

<html class="ui-mobile-rendering"><头><meta charset="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><title>JQM 弹窗测试</title><link rel="样式表"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><身体><a href="#popupBasic" data-rel="popup">工具提示</a><div data-role="popup" id="popupBasic">这是一个完全基本的弹出窗口,没有设置任何选项.</div><div>其他</div><div>随机</div><div>文本</div>

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

I tried the code in the example

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

<div data-role="popup" id="popupBasic">
    This is a completely basic popup, no options set.
</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?

解决方案

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>

这篇关于jquery 移动弹出窗口不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆