小编E T*_*E T的帖子

如何检测Chrome中是否已授予麦克风权限

我希望检测在加载时是否已在我的网站上授予麦克风权限,而不实际运行如下所示的内容:

navigator.webkitGetUserMedia({audio: active}, 
    function(){alert('worked')}, 
    function(){alert('failed')});
Run Code Online (Sandbox Code Playgroud)

是否有一个简单的API来检测用户是否已永久授予我的应用程序(通过https运行)的麦克风访问权限?

javascript google-chrome

13
推荐指数
2
解决办法
6384
查看次数

Google Charts Vertical Axis上的重复数字

当其中一个轴变得奇怪并开始重复数字(即:1,1,2,2而不是1,2,3,4)时,我正在使用谷歌可视化的错误修复为组合(列/线)图表.请看下面的图片

重复轴http://913a0d0e6c09b4bcc628-22cb2ea15f760b88c7ec5dccd300db1d.r25.cf1.rackcdn.com/duplicate_axes.png

以下是图表选项设置:

// Instantiate and draw our chart, passing in some options. 
var frequency_by_day_options = {
    vAxes: [
        {format:'#,###', title:"Call Volume"}, 
        {format: '#%', title:'Missed Call Rate',
          viewWindow:{
            max:1,
          }}
        ],      
    legend: {position: 'none'},
    chartArea: { height:'60%', width:'60%'},
    width: 800,
    height: 350,
    backgroundColor: 'transparent',
    bar: { groupWidth: '90%'},
    isStacked: true,
    seriesType: 'bars',
    series: {0: {type:'bar', targetAxisIndex:0}, 1: {type:'line', targetAxisIndex:1},},
    colors: ['blue', 'green'],
    animation:{
        duration: 1000,
        easing: 'out',},
    };
Run Code Online (Sandbox Code Playgroud)

我不知道这里发生了什么.即使我注释掉所有vAxis选项,我仍然会观察到这种行为.关于我做错什么的任何想法?这让我疯了:)

google-visualization

3
推荐指数
1
解决办法
3318
查看次数

div高度重置时css背景重复

我有以下html/javascript实现.我的目标是在保持纵横比的同时调整图像大小,以获取浏览器窗口的高度/宽度.但是,在实现此代码时,每个resize事件都会增加div高度(旧高度+新高度,而不是将其设置为新高度.如何阻止div以这种方式增长?

<div class="header-pc" style="background-image: url('assets/sunset-flipped1.png');background-size: 100% auto;height:1000px"></div>

function resizeHeaderPic(){
    var height = $(window).height();
    $('.header-pc').height(height);f
}
$(document).ready(function(){
    //resizeHeaderPic();
    $(window).resize(function(){
        resizeHeaderPic();
    });
});
Run Code Online (Sandbox Code Playgroud)

html javascript css jquery background

2
推荐指数
1
解决办法
99
查看次数