Using alert with ajax removal

I used the default confirmation box to delete the entry using ajax, and it worked awkwardly. here is the working code http://pastebin.com/HZxDVAgU But when I warn him, he deletes the record, but does not hide it. here is the idle code http://pastebin.com/7q1sH5gM

this is the code that hides the entry

  $(this).parents(".record").animate({ backgroundColor: "#fbc7c7" }, "fast")
    .animate({ opacity: "hide" }, "slow");
+3
source share
1 answer

Inside warning callbacks, thisrefer to the window to refer to the called party object; you can use a variable elementthat stores a link to the source element.

the code:

        element.parents(".record").animate({
            backgroundColor: "#fbc7c7"
        }, "fast")
            .animate({
            opacity: "hide"
        }, "slow");

Demo: http://jsfiddle.net/IrvinDominin/PUh6f/

0
source

All Articles