Sometime we just need to use simple jQuery on checkout page but checkout element bind with knockout js so our jQuery not work smoothly so below is a way to call your jQuery after bind perticular element.
function waitForElement(query, callback){
var poops = setInterval(function(){
if(document.querySelector(query)){
clearInterval(poops);
callback();
}
}, 100);
}
waitForElement(".class", function(){
alert("element is loaded.. do stuff");
});
0 comments:
Post a Comment