jQuery:延迟变量play()函数? [英] jQuery: Delay a variables play() function?
本文介绍了jQuery:延迟变量play()函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我对使用jQuery很陌生,并且正在使用以下代码在页面中插入淡入色div
.
I'm quite new to using jQuery and I'm using the following code to insert fade the div
into the page.
$("#DivIdGoesHere").delay(time).fadeIn(time);
我正在使用以下代码播放声音文件.
And i am using the following code to play the sound file.
var shrill_strings = new Audio('audio/shrill_strings.ogg');
shrill_strings.play();
我只是想知道是否有一种方法可以做到:
I was just wondering if there is a way to do like :
$shrill_stings.delay(time).play(time);
感谢您的帮助.
推荐答案
setTimeout(function () {
new Audio('audio/shrill_strings.ogg').play();
}, 1000);
这篇关于jQuery:延迟变量play()函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文