Adding on to wizzud's response, what you are seeing is a FOUC(flash of unstyled content) that happens when the browser renders the content before javascript has had a chance to add the styling classes. By adding the classes beforehand as mentioned by wizzud, you avoid the FOUC by styling the content prior to the browser rendering it.
-- Kevin