I've got a problem. In the produced by PHP file I've got a jQuery gallery wordpress plugin that ought to make display:none to any or all the pictures that have been put into correct order by PHP in divs. But apparently, after i run, When i first see images loading in the page, after which JavaScript gallery run and hides images and demonstrate to them in right way.

I must run my script before browser would attempt to load images from divs around the page. I have them in separate divs to ensure that it's Search engine optimization friendly and when JavaScript is switched off they'll be proven altogether on a single page.

Your body is one thing like:

    <img> ...  </img>
<script type="text/javascript">
    jQuery(window).load(function() {

You want to begin with initial default classes to prevent a 'Flash Of Unstyled Content' (sometimes known to as FOUC).

However, you will be in better shape if you are using the jQuery(document).ready(function(){}) call rather than $(window).load(fn). Document.ready is fired prior to the images load, while window.load does not occur until individuals images have loaded.