vadimsva / waitMe

jquery plugin for easy creating loading css3/images animations
http://vadimsva.github.io/waitMe/
MIT License
328 stars 84 forks source link

Add an global option which is a callback to be called when waitMe element is removed #6

Closed ryanlin1986 closed 8 years ago

ryanlin1986 commented 8 years ago

In scenario like knockoutjs, if we call waitMe first, and ko.applyBindings, we just can not remove waitMe later directly, we need use ko.cleanNode first to clear knockout specific data, or memory leaks.

vadimsva commented 8 years ago

Ok, use new 1.14 version. You can use: elem.waitMe({..., onClose: function() { } }); or use trigger elem.on('close', function(){ });

ryanlin1986 commented 8 years ago

Thanks, that's perfect.

burhan07 commented 8 years ago

hi,

call

function run_waitMe(effect){
    $('.containerBlock > form').waitMe({
        effect: effect,
        text: 'Please wait...',
        bg: 'rgba(255,255,255,0.7)',
        color:'#000',
        sizeW:'',
        sizeH:'',
        source: 'img.svg',
        onClose: function() {}
    });
}

not continue it is loop waitingeffect. I am atest call javascrtip command. /* for example issue function run_waitMe(effect){ $('.containerBlock > form').waitMe({ effect: effect, text: 'Please wait...', bg: 'rgba(255,255,255,0.7)', color:'#000', sizeW:'', sizeH:'', source: 'img.svg', onClose: function() {} });

alert("not continiu"); // this not work alert message // j query get data and post // and close waiting } */ can you help me this issue ? Thank you for helping.

Best regards. Burhan KARADERE

vadimsva commented 8 years ago

Hi, I don't understand what your problem

burhan07 commented 8 years ago

I am called run_waitMe function

ajax jquery data post method if post success hide wait me not work and not ajax function

function run_waitMe(effect){ $('.containerBlock > form').waitMe({ effect: effect, text: 'Please wait...', bg: 'rgba(255,255,255,0.7)', color:'#000', sizeW:'', sizeH:'', source: 'img.svg', onClose: function() {} });

// not continue this line

        $.ajax({
            type     : "POST",
            cache    : false,
            url      : url,
            data: $("#divcontent").serializeArray(),
            success  : function(data) {
                $("#location").html(data);

               $('.containerBlock > form').waitMe('hide');

            }
        });
vadimsva commented 8 years ago

You have error in ajax, data is all html, not $("#divcontent"). Use: dataString = $("#divcontent").serializeArray(); $.ajax({ type : "POST", cache : false, url : url, data: dataString, success : function() { $("#location").html(dataString); $('.containerBlock > form').waitMe('hide'); } });