0

I am showing a popup in an iframe. In parent body I showed loader as

$('body').loader('show');

How can I hide this loader by accessing parent body, I know parent body can be accessed as

window.parent.document.body

This works for me:

$('.loading-mask', window.parent.document.body).css('display', 'none');

But I need to know what is the best way to do this ?

Tried:

$('body', window.parent.document).loader('hide');
window.parent.$.body.loader('hide');

but no luck, any idea ??

2
  • The method you're using is fine. The only improvement I'd suggest is to use hide() instead of css() Commented Nov 29, 2018 at 9:09
  • @RoryMcCrossan: Thanks a lot, have used your suggestion. I was just seeking the best way to hide loader from parent body. Commented Nov 29, 2018 at 9:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.