1

我在我的网站 ( http://www.simpleprods.com ) 上添加了对 Jquery Mobile 的引用,以获取事件 vmousedown、vmouseup 等。我只需要这些,尽管 JQuery mobile 烦人地向我的网页添加了一些丑陋的自动加载消息。它 100% 来自 JQuery 手机。我只想要 vmousedown、vmouseup 和 vmousemove,我不需要任何加载消息和那个橙色框。我已经知道如何取消消息,但橙色框就是无法摆脱。

有谁知道该怎么做?如果有人能告诉我如何在没有 JQuery mobile 拥有的所有其他东西的情况下获得 vmousedown、vmouseup 和 vmousemove,我会很高兴......

4

2 回答 2

2

您可以重建 jQuery Mobile 框架以仅具有您需要的功能。

去这个网站:

http://jquerymobile.com/download-builder/

选择:

虚拟鼠标 (vmouse) 绑定

之后,只需单击Build My Download

例子:

<!DOCTYPE html>
<html>
<head>
    <title>jQM Complex Demo</title>
    <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=no; target-densityDpi=device-dpi"/>
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
    <script type="text/javascript" src="http://www.dragan-gaic.info/js/jquery-1.8.2.min.js"></script>   
    <script src="jquery.mobile.custom.js"></script> 
    <script>
        $(document).on('vmousedown', '[data-role="content"]', function(){       
            alert('asdas');
        }); 
    </script>   
</head>
<body>
    <div data-role="page" id="index">
        <div data-theme="a" data-role="header">
            <h3>
                First Page
            </h3>
        </div><p></p>

        <div data-role="content" style="height: 100px; width: 500px; background: #aabbcc;">
            <div data-role="popup" id="initialpopup" data-overlay-theme="a" data-theme="a">Foobar</div>
        </div>

        <div data-theme="a" data-role="footer" data-position="fixed">

        </div>
    </div>   
</body>
</html>   

您只需要从构建器工具中提供一个jquery.mobile.custom.js文件。

于 2013-03-15T19:09:08.140 回答
0

确保您没有在<body>标签中包含脚本。这可能会导致加载标签在不应该出现的时候出现。

于 2013-03-15T19:38:54.190 回答