0

I am using javascript to load my CSS files. I want to run a function once all CSS files have been downloaded and painted.

I do have jQuery loaded so I can use one of its functions.

.ready and .load don't seem to be waiting for CSS to complete the paint.

Thank you for your help.

user3376563
  • 313
  • 1
  • 10
  • I couldn't find the link. Can you please list where it has been answered? I see a lot of questions answering how to wait for load but not specifically for CSS paint wait. Thanks. – user3376563 Jun 01 '14 at 16:04

1 Answers1

0

Go for this :

//Checks if to.css and to1.css are loaded or not.

if ($("link[href='/path/to.css']").length && $("link[href='/path/to1.css']").length )
{
   //Function after above 2 CSS are loaded.
}
Pratik Joshi
  • 11,485
  • 7
  • 41
  • 73