1
Reply

Jquery Recursive Function Call

Aniket Narvankar

Aniket Narvankar

Sep 3 2015 12:50 AM
408
 function BetBgGlow() {
        if (check == 0) {
            $("#" + betbg).css('background-image', 'url(images/Betbg.png)').show();
            betbgglow = setTimeout(function () { $("#" + betbg).css('background-image', 'url(images/BetGlow.png)').show(); }, 200);
            betbgwinglow = setTimeout(BetBgGlow, 500);
        }
        else {
                clearTimeout(betbgglow);
                clearTimeout(betbgwinglow);
            $("#" + betbg).css('background-image', 'url(images/Betbg.png)').show();
        }
    }
 
 
I have to call BetBgGlow function till check is 0,that I have done but using setTimeout,but I have to call a function recursively without using setTimeout or setInterval method.Please let me know how this could be done using jquery.
 
I am stuck on this. 

Answers (1)