草庐IT

background-audio

全部标签

ios - html5 <audio> 无法在 IOS Safari 上播放

我有一个mp3可以通过旧浏览器中的嵌入标签正确播放,但是对于iPad,当我尝试通过播放相同的mp3时,它说不支持电影。这是MIME类型问题吗?此方法适用于桌面Safari。如何让它在IOS4.3下的Safari上播放?这是我的代码:varaudio=document.createElement('audio');audio.type="audio/mpeg";audio.src=audioUrl;x.appendChild(audio);audio.load();audio.play(); 最佳答案 从4.x开始,iOS不再支持ht

ios - html5 <audio> 无法在 IOS Safari 上播放

我有一个mp3可以通过旧浏览器中的嵌入标签正确播放,但是对于iPad,当我尝试通过播放相同的mp3时,它说不支持电影。这是MIME类型问题吗?此方法适用于桌面Safari。如何让它在IOS4.3下的Safari上播放?这是我的代码:varaudio=document.createElement('audio');audio.type="audio/mpeg";audio.src=audioUrl;x.appendChild(audio);audio.load();audio.play(); 最佳答案 从4.x开始,iOS不再支持ht

html - Firefox 中的圆 Angular : space between border and background

我有一个要应用圆Angular的div。这是我的demofiddle. div{margin:20px;width:250px;height:250px;-moz-border-radius:15px;-webkit-border-radius:15px;-khtml-border-radius:15px;border-radius:15px;background-color:#4c66a1;border:2pxsolid#4c66a1;}我还为这个div应用了边框和背景色。问题出现在Firefox中。在div的边框和背景颜色之间有少量空白(见下图)。它非常小,但人们还是注意

html - Firefox 中的圆 Angular : space between border and background

我有一个要应用圆Angular的div。这是我的demofiddle. div{margin:20px;width:250px;height:250px;-moz-border-radius:15px;-webkit-border-radius:15px;-khtml-border-radius:15px;border-radius:15px;background-color:#4c66a1;border:2pxsolid#4c66a1;}我还为这个div应用了边框和背景色。问题出现在Firefox中。在div的边框和背景颜色之间有少量空白(见下图)。它非常小,但人们还是注意

javascript - HTML5 : How to get currentTime and duration of Audio Tag in milliseconds

我在我的模板中使用HTML5音频标签播放声音文件。出于某种目的,我需要跟踪显示最多毫秒的currentTime和持续时间。现在我只能在几秒钟内获得这些值。有什么可能的方法吗?下面是我的代码:HTML"ontimeupdate="TrackAudio(this)">YourbrowserdoesnotsupporttheaudioelementJAVASCRIPTfunctionTrackAudio(element){varcurTime=Math.floor(element.currentTime);console.log(curTime)//Valueinseconds.}

javascript - HTML5 : How to get currentTime and duration of Audio Tag in milliseconds

我在我的模板中使用HTML5音频标签播放声音文件。出于某种目的,我需要跟踪显示最多毫秒的currentTime和持续时间。现在我只能在几秒钟内获得这些值。有什么可能的方法吗?下面是我的代码:HTML"ontimeupdate="TrackAudio(this)">YourbrowserdoesnotsupporttheaudioelementJAVASCRIPTfunctionTrackAudio(element){varcurTime=Math.floor(element.currentTime);console.log(curTime)//Valueinseconds.}

javascript - jQuery/CSS : fixed overlay should not allow scrolling of background?

我有一个固定在屏幕中央的覆盖框。该页面本身相当长,并且有一个垂直滚动条。我想在显示叠加层后禁用页面本身的滚动。但是我不能完全禁用滚动,因为一些叠加层本身确实有overflow-y:scroll。因此叠加层中的内容应该滚动,但页面本身应该卡住。知道如何用jquery或css解决这个问题吗? 最佳答案 我能想到的最快和最肮脏的方法是为滚动事件的窗口附加一个事件监听器,如果您的叠加层可见则防止默认()。像这样(使用jquery)。window.addEventListener('scroll',function(e){varel=$('.

javascript - jQuery/CSS : fixed overlay should not allow scrolling of background?

我有一个固定在屏幕中央的覆盖框。该页面本身相当长,并且有一个垂直滚动条。我想在显示叠加层后禁用页面本身的滚动。但是我不能完全禁用滚动,因为一些叠加层本身确实有overflow-y:scroll。因此叠加层中的内容应该滚动,但页面本身应该卡住。知道如何用jquery或css解决这个问题吗? 最佳答案 我能想到的最快和最肮脏的方法是为滚动事件的窗口附加一个事件监听器,如果您的叠加层可见则防止默认()。像这样(使用jquery)。window.addEventListener('scroll',function(e){varel=$('.

html - CSS 拼图 : How to add background-image and set height/width on empty span?

我已经在几个span元素上设置了background-image,但它们没有显示,我想是因为我的height和width设置被忽略。HTML来源:CSS:span.sidebar-poster{margin-bottom:10px;background-repeat:no-repeat;width:160px;}span#starthere{background-image:url(/betatesting/wp-content/themes/dynamik/css/images/brunelwantsyou180.jpg);height:285px;}span#starthere:h

html - CSS 拼图 : How to add background-image and set height/width on empty span?

我已经在几个span元素上设置了background-image,但它们没有显示,我想是因为我的height和width设置被忽略。HTML来源:CSS:span.sidebar-poster{margin-bottom:10px;background-repeat:no-repeat;width:160px;}span#starthere{background-image:url(/betatesting/wp-content/themes/dynamik/css/images/brunelwantsyou180.jpg);height:285px;}span#starthere:h