Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/472.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何仅在UC迷你浏览器的速度模式下播放div?_Javascript_Jquery_Html_Css_Browser - Fatal编程技术网

Javascript 如何仅在UC迷你浏览器的速度模式下播放div?

Javascript 如何仅在UC迷你浏览器的速度模式下播放div?,javascript,jquery,html,css,browser,Javascript,Jquery,Html,Css,Browser,我试图仅当用户在速度模式下使用uc迷你浏览器时才显示div(就像在maxfunzone.com中那样)。下面是我的标记。在这个话题上的任何帮助都是非常值得赞赏的 <!doctype html> <html> <head> <meta charset="utf-8"> <title>UC Mini</title> <script src="https://ajax.googleapis.com/ajax/libs/jqu

我试图仅当用户在速度模式下使用uc迷你浏览器时才显示div(就像在maxfunzone.com中那样)。下面是我的标记。在这个话题上的任何帮助都是非常值得赞赏的

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>UC Mini</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    if (navigator.userAgent.match(/^Mozilla\/5\.0 .+ Gecko\/$/)) {
  $(".info-box").show();
}
else {
  $(".info-box").hide();
}
});
</script>
<style>
.info-box{display: none}
</style>
</head>
<body>
<div class="info-box">
some text here
</div>
</body>
</html> 

加州大学迷你
$(文档).ready(函数(){
if(navigator.userAgent.match(/^Mozilla\/5\.0.+Gecko\/$/)){
$(“.info框”).show();
}
否则{
$(“.info框”).hide();
}
});
.info框{显示:无}
这里有一些文字

我已更新了您的html,请检查以下html代码片段。我想这可能对你有帮助

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>UC Mini</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<style>
    /* webpage/global style goes here */
        h1{
            color:#008000;
        }
</style>
</head>
<body>
<noscript>
    <!-- Note: Style in 'noscript' tag will not reflect on out side elements when speed mode is off or javascript is turned on. 
         Switch modes in UC mini browser to check the difference.
    -->
    <style>
    /* noscript specific style goes here. */
        .info-box{font-size:12px;color:#FF0000;font-weight:bold;}
        h1{
            color:#2187E7;
        }
    </style>
    <div class="info-box">Please turn on javascript or turn off speed mode to make site functional.</div>
</noscript>
<h1>HTML5 is Amazing!</h1>
</body>
</html>

加州大学迷你
/*网页/全球风格在这里*/
h1{
颜色:#008000;
}
/*noscript特定的样式在这里*/
.info框{字体大小:12px;颜色:#FF0000;字体重量:粗体;}
h1{
颜色:#2187E7;
}
请打开javascript或关闭速度模式以使站点正常运行。
HTML5太棒了!

我已更新了您的html,请检查以下html代码片段。我想这可能对你有帮助

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>UC Mini</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<style>
    /* webpage/global style goes here */
        h1{
            color:#008000;
        }
</style>
</head>
<body>
<noscript>
    <!-- Note: Style in 'noscript' tag will not reflect on out side elements when speed mode is off or javascript is turned on. 
         Switch modes in UC mini browser to check the difference.
    -->
    <style>
    /* noscript specific style goes here. */
        .info-box{font-size:12px;color:#FF0000;font-weight:bold;}
        h1{
            color:#2187E7;
        }
    </style>
    <div class="info-box">Please turn on javascript or turn off speed mode to make site functional.</div>
</noscript>
<h1>HTML5 is Amazing!</h1>
</body>
</html>

加州大学迷你
/*网页/全球风格在这里*/
h1{
颜色:#008000;
}
/*noscript特定的样式在这里*/
.info框{字体大小:12px;颜色:#FF0000;字体重量:粗体;}
h1{
颜色:#2187E7;
}
请打开javascript或关闭速度模式以使站点正常运行。
HTML5太棒了!

为什么要这样做?:)因为页面设计在uc最小速度模式下中断。;)如果uc mini speed没有破坏您的布局,那么我会说uc speed模式有缺陷或者没有正确实施。为什么?这是因为速度模式必须优化页面中的布局、缓存、图像、样式表、js文件和其他内容,才能让用户知道速度模式正在工作。这只是一种更快地加载东西的方法,而不是标准方式,但您的想法是错误的。希望这有助于我知道这只是一种更快加载东西的方法。但我想让用户知道,切换模式将有助于他/她观看网页,而不会出现扭曲的布局。这是用户可以做出的选择。对于相同的消息,我想使用div。希望这现在有意义。根据我在web技术方面的经验,我不知道解决这个问题的任何方法。你为什么要这样做?:)因为页面设计在uc最小速度模式下中断。;)如果uc mini speed没有破坏您的布局,那么我会说uc speed模式有缺陷或者没有正确实施。为什么?这是因为速度模式必须优化页面中的布局、缓存、图像、样式表、js文件和其他内容,才能让用户知道速度模式正在工作。这只是一种更快地加载东西的方法,而不是标准方式,但您的想法是错误的。希望这有助于我知道这只是一种更快加载东西的方法。但我想让用户知道,切换模式将有助于他/她观看网页,而不会出现扭曲的布局。这是用户可以做出的选择。对于同样的信息,我想使用div。希望这现在有意义。根据我在网络技术方面的经验,我不知道解决这个问题的任何方法。。