javascript - jQuery 移动加载

标签 javascript jquery html css jquery-mobile

我想在我正在构建的网站的移动版本上的图片库上有一些滑动功能,所以我一直在使用 jQuery,我想我会使用 jQuery Mobile swipeleftswiperight 事件。这一切都很好,但我注意到当页面加载时,我在页面上看到加载字样。

这是加载小部件吗?如果是这样,我该如何设置它以使其不显示?

最佳答案

您可以通过以下方式关闭它:

$( document ).bind( 'mobileinit', function(){
    $.mobile.loader.prototype.options.text = "loading";
    $.mobile.loader.prototype.options.textVisible = false;
    $.mobile.loader.prototype.options.theme = "a";
    $.mobile.loader.prototype.options.html = "";
});

知道必须在 HEAD 内初始化 jQuery Mobile 之前初始化此 block 也很好,如下所示:

<!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 src="http://www.dragan-gaic.info/js/jquery-1.8.2.min.js"></script>          
    <script>
        $( document ).bind( 'mobileinit', function(){
            $.mobile.loader.prototype.options.text = "loading";
            $.mobile.loader.prototype.options.textVisible = false;
            $.mobile.loader.prototype.options.theme = "a";
            $.mobile.loader.prototype.options.html = "";
        });     
    </script>
    <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>    
</head>

查找有关此功能的更多信息 here .

关于javascript - jQuery 移动加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15206515/

相关文章:

javascript - 设置新值时,Knockout Force 会通知订阅者可观察值

javascript - 将倒计时设置为日期和时间,以及客户的时区

javascript - 用 AM 排序日期和时间 |在 jquery 中PM

javascript - 单击 anchor 书签时防止滚动事件

php - jQuery : getting PHP variables by AJAX

javascript - 如何使嵌入式图表响应

jquery - jquery Parallax 的跨浏览器滚动问题

javascript - Youtube - 自定义播放图标

jquery - 如何使这个消失/重新出现的 AJAX 加载 GIF 停止移动其他元素?

javascript - 对两个图像使用一个函数