开发者

jquery, how to use trigger?

开发者 https://www.devze.com 2023-04-11 03:44 出处:网络
i have this situation: if(isset($_POST[\"sm\"]) { print \"<br><div id=\\\"redirect\\\">success</div>\";

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

精彩评论

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