【问题标题】:browser Images on android only show after refreshandroid上的浏览器图像仅在刷新后显示
【发布时间】:2012-08-19 01:19:32
【问题描述】:

我正在使用 Modernizr 来检测不支持的 SVG 浏览器,并为不支持它的浏览器加载额外的样式表。图片由 CSS 中的 background-urls 设置。

图像起初没有显示在我的 Android 浏览器中,但是当我刷新它们加载的页面时。在这样做之前,我确定缓存已被清除。我也在使用 Jquery Mobile,但没有使用它的任何样式。

这是我的标题:

    <head>
    <meta charset="utf-8">
    <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
    <title>My Website</title>

    <meta http-equiv="x-dns-prefetch-control" content="off">

    <meta name="viewport" content="width=device-width, target-densityDpi=160, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

    <link href="<?php bloginfo('template_url'); ?>/css/reset.css" rel="stylesheet" />
    <link href="<?php bloginfo('stylesheet_url'); ?>" rel="stylesheet" />

    <script type="text/javascript" src="http://use.typekit.com/abv4xxx.js"></script>
    <script type="text/javascript">try{Typekit.load();}catch(e){}</script>

    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/mobile.js"></script>
    <script type="text/javascript" src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
    <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/modernizer.js"></script>
    <script type="text/javascript">

    Modernizr.load({
    test: Modernizr.svg,
        nope: '<?php bloginfo("template_url"); ?>/css/nono-svg.css'
    });

    </script>
    <?php wp_head(); ?>
</head>

【问题讨论】:

    标签: android jquery-mobile modernizr


    【解决方案1】:

    我找到了解决方案。我不得不将我的 js 脚本移动到 modernizr 的加载命令中。

    <head>
        <meta charset="utf-8">
        <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
        <title>My Website</title>
    
        <meta http-equiv="x-dns-prefetch-control" content="off">
    
        <meta name="viewport" content="width=device-width, target-densityDpi=160, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    
        <link href="<?php bloginfo('template_url'); ?>/css/reset.css" rel="stylesheet" />
        <link href="<?php bloginfo('stylesheet_url'); ?>" rel="stylesheet" />
    
        <script type="text/javascript" src="http://use.typekit.com/abv4xxx.js"></script>
        <script type="text/javascript">try{Typekit.load();}catch(e){}</script>
    
        <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/modernizer.js"></script>
        <script type="text/javascript">
    
        Modernizr.load({
            load: ['https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js',
                '<?php bloginfo("template_url"); ?>/js/mobile.js',
                'http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js'
            ],
            test: Modernizr.svg,
                nope: '<?php bloginfo("template_url"); ?>/css/nono-svg.css'
        });
    
        </script>
        <?php wp_head(); ?>
    </head>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-04-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-18
      • 1970-01-01
      • 2021-06-13
      相关资源
      最近更新 更多