开发者

jquery, how to use trigger?

i have this situation:

if(isset($_POST["sm"]) {
    print "<br><div id=\"redirect\">success</div>";
}

in javascript i have:

$('#redirect').delay(2000).fadeOut('slow');

what happens is that if the form is submitted that div shows up for two seconds then faced out, but i also want to trigger a click by using: $('#test').trigger('click');

how can i connect them together so that when the div sh开发者_运维问答ows i also trigger the click.

also i cant use javascript inside the php if statement

any ideas?

thanks


Maybe something like this:

$("#redirect").fadeOut("2000", function(){
                $('#test').trigger('click');
            });
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜