开发者

Focus lost with jAlert plugin

开发者 https://www.devze.com 2023-04-13 04:01 出处:网络
I\'m calling jAlert with this function $(\'.stcommentdelete\').live(\"click\",function() { var ID = $(this).attr(\"id\");

I'm calling jAlert with this function

$('.stcommentdelete').live("click",function() {
    var ID = $(this).attr("id");
    var dataString 开发者_开发技巧= 'com_id='+ ID;

    jConfirm('Oled sa kindel, et tahad kustutada??', '', function(r){
        if(r==true){
            $.ajax({
                type: "POST",
                url: "delete_comment_ajax.php",
                data: dataString,
                cache: false,
                success: function(html){
                    $("#stcommentbody"+ID).slideUp();
                }
            });
        }
    });
});

If i have for example 15 comments and i would delete last comment, it scrolls up. But i need that it stays focused on this place where i delete comment.

Omerimuni


I found what was wrong in my script. I called this script from link like a href="#". I remove href="#" and it works. :D Sry for bother u guys ;)

0

精彩评论

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