Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.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
Jquery 增加延误_Jquery - Fatal编程技术网

Jquery 增加延误

Jquery 增加延误,jquery,Jquery,我目前已经安装了PrettyTo,并通过 $(document).ready(function(){ 添加延迟的最快方法是什么?javascript中的函数很容易使用 你可能会这样做 $(document).ready(function(){ $('#photo').prettyphoto(); //Not sure how you call prettyphoto } 在您拨打电话之前添加延迟: $(document).ready(function(){ //The cal

我目前已经安装了PrettyTo,并通过

$(document).ready(function(){
添加延迟的最快方法是什么?

javascript中的函数很容易使用

你可能会这样做

$(document).ready(function(){
    $('#photo').prettyphoto(); //Not sure how you call prettyphoto
}
在您拨打电话之前添加延迟:

$(document).ready(function(){
    //The call to callPrettyPhoto will only be made after 1 second
    window.setTimeout(callPrettyPhoto, 1000 );
});

function callPrettyPhoto() {
    $('#photo').prettyphoto();
}
请注意,如果希望将函数内联,也可以将其内联:

$(document).ready(function(){
    window.setTimeout(function() {
        $('#photo').prettyphoto();
    }, 1000);
});

哇!非常感谢你,米尼隆先生-非常出色,非常感谢:)