Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/406.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 触发器onClick();页面加载_Javascript_Jquery - Fatal编程技术网

Javascript 触发器onClick();页面加载

Javascript 触发器onClick();页面加载,javascript,jquery,Javascript,Jquery,我想在页面完全加载后自动执行$(“.rope”)。单击()函数 <script type="text/javascript"> $(document).ready(function() { $curtainopen = false; $(".rope").click(function(){ $(this).blur(); if ($curtainopen == false){

我想在页面完全加载后自动执行$(“.rope”)。单击()函数

    <script type="text/javascript">
    $(document).ready(function() {

        $curtainopen = false;
        $(".rope").click(function(){
            $(this).blur();
            if ($curtainopen == false){ 
                $(this).stop().animate({top: '0px' }, {queue:false, duration:350, easing:'easeOutBounce'}); 
                $(".leftcurtain").stop().animate({width:'60px'}, 4500 );
                $(".rightcurtain").stop().animate({width:'60px'},4500 );
                $curtainopen = true;
            }else{
                $(this).stop().animate({top: '-40px' }, {queue:false, duration:350, easing:'easeOutBounce'}); 
                $(".leftcurtain").stop().animate({width:'50%'}, 4500 );
                $(".rightcurtain").stop().animate({width:'51%'},4500 );
                $curtainopen = false;
            }
            return false;
        });

    }); 
</script>

$(文档).ready(函数(){
$curtainopen=false;
$(“.rope”)。单击(函数(){
$(this.blur();
如果($curtainopen==false){
$(this.stop().animate({top:'0px'},{queue:false,duration:350,easeOutBounce'});
$(“.left窗帘”).stop().animate({width:'60px'},4500);
$(“.Right窗帘”).stop().animate({width:'60px'},4500);
$curtainopen=true;
}否则{
$(this.stop().animate({top:'-40px'},{queue:false,duration:350,easeOutBounce'});
$(“.left窗帘”).stop().animate({width:'50%”,4500);
$(“.Right窗帘”).stop().animate({width:'51%},4500);
$curtainopen=false;
}
返回false;
});
}); 

请提供帮助。

您可以在您的侦听器定义之后编写以下内容:

$(".rope").click()


您可以在侦听器定义之后编写:

$(".rope").click()


您可以在侦听器定义之后编写:

$(".rope").click()


您可以在侦听器定义之后编写:

$(".rope").click()

在dom ready with selector中使用
.click()
.trigger('click')

$(".rope").click();
//or
$(".rope").trigger('click');
在dom ready with selector中使用
.click()
.trigger('click')

$(".rope").click();
//or
$(".rope").trigger('click');
在dom ready with selector中使用
.click()
.trigger('click')

$(".rope").click();
//or
$(".rope").trigger('click');
在dom ready with selector中使用
.click()
.trigger('click')

$(".rope").click();
//or
$(".rope").trigger('click');

我想把它锁在后面:

$(".rope").click(function(){
    $(this).blur();
    if ($curtainopen == false){ 
        $(this).stop().animate({top: '0px' }, {queue:false, duration:350, easing:'easeOutBounce'}); 
        $(".leftcurtain").stop().animate({width:'60px'}, 4500 );
        $(".rightcurtain").stop().animate({width:'60px'},4500 );
        $curtainopen = true;
    }else{
        $(this).stop().animate({top: '-40px' }, {queue:false, duration:350, easing:'easeOutBounce'}); 
        $(".leftcurtain").stop().animate({width:'50%'}, 4500 );
        $(".rightcurtain").stop().animate({width:'51%'},4500 );
        $curtainopen = false;
    }
    return false;
}).click();

我想把它锁在后面:

$(".rope").click(function(){
    $(this).blur();
    if ($curtainopen == false){ 
        $(this).stop().animate({top: '0px' }, {queue:false, duration:350, easing:'easeOutBounce'}); 
        $(".leftcurtain").stop().animate({width:'60px'}, 4500 );
        $(".rightcurtain").stop().animate({width:'60px'},4500 );
        $curtainopen = true;
    }else{
        $(this).stop().animate({top: '-40px' }, {queue:false, duration:350, easing:'easeOutBounce'}); 
        $(".leftcurtain").stop().animate({width:'50%'}, 4500 );
        $(".rightcurtain").stop().animate({width:'51%'},4500 );
        $curtainopen = false;
    }
    return false;
}).click();

我想把它锁在后面:

$(".rope").click(function(){
    $(this).blur();
    if ($curtainopen == false){ 
        $(this).stop().animate({top: '0px' }, {queue:false, duration:350, easing:'easeOutBounce'}); 
        $(".leftcurtain").stop().animate({width:'60px'}, 4500 );
        $(".rightcurtain").stop().animate({width:'60px'},4500 );
        $curtainopen = true;
    }else{
        $(this).stop().animate({top: '-40px' }, {queue:false, duration:350, easing:'easeOutBounce'}); 
        $(".leftcurtain").stop().animate({width:'50%'}, 4500 );
        $(".rightcurtain").stop().animate({width:'51%'},4500 );
        $curtainopen = false;
    }
    return false;
}).click();

我想把它锁在后面:

$(".rope").click(function(){
    $(this).blur();
    if ($curtainopen == false){ 
        $(this).stop().animate({top: '0px' }, {queue:false, duration:350, easing:'easeOutBounce'}); 
        $(".leftcurtain").stop().animate({width:'60px'}, 4500 );
        $(".rightcurtain").stop().animate({width:'60px'},4500 );
        $curtainopen = true;
    }else{
        $(this).stop().animate({top: '-40px' }, {queue:false, duration:350, easing:'easeOutBounce'}); 
        $(".leftcurtain").stop().animate({width:'50%'}, 4500 );
        $(".rightcurtain").stop().animate({width:'51%'},4500 );
        $curtainopen = false;
    }
    return false;
}).click();

我不会对每个答案都发表评论,而是在这里告诉你:
。trigger('click')
快。click()
。我不会对每个答案发表评论,而是在这里告诉你:
。trigger('click')
快。click()
。我不会对每个答案发表评论,而是在这里告诉你:
。trigger('click'))
快。click()
。我在这里告诉您:
。trigger('click')
快。click()