Title: Jquery Onload does not work&#8230;
Last modified: August 22, 2016

---

# Jquery Onload does not work…

 *  Resolved [Number1.0](https://wordpress.org/support/users/number10/)
 * (@number10)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/jquery-onload-does-not-work/)
 * Hey,
 * This is an awesome plugin…
 * Only problem is that it slightly breaks my website…
 * Easiest way to explain is to show you….
 * Look at this website…
 * [http://mazionfirstaidtraining.co.uk/courses/]([http://mazionfirstaidtraining.co.uk/courses/](http://mazionfirstaidtraining.co.uk/courses/))
 * The boxes are of different sizes on load, If you resize the browser, the boxes
   will resize the same size… This function (that makes all the boxes the same size)
   is supposed to work on load as well as on resize (and now it only works on resize)…
 * Thus, I would appreciate if someone could show me where I’m making the mistake…
 * I think it is that Jquery isn’t loaded (since it is all in one file) on load…
   
   What do you think….
 * [https://wordpress.org/plugins/autoptimize/](https://wordpress.org/plugins/autoptimize/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/jquery-onload-does-not-work/#post-5739652)
 * Well, in that case I’d exclude jquery from being optimized. There [more info in the FAQ](https://wordpress.org/plugins/autoptimize/faq/)
   on that.
 * Hope this helps,
    frank
 *  Thread Starter [Number1.0](https://wordpress.org/support/users/number10/)
 * (@number10)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/jquery-onload-does-not-work/#post-5739805)
 * Thanks Frank,
 * After digging into the problem, I found out the problem wasn’t actually JS, but
   rather it was the Critical CSS I was using… I created a Stackoverflow post on
   it ([ see here ](http://stackoverflow.com/questions/28289634/when-using-critical-css-jquery-function-does-is-not-running-on-load))
 * Apparently the critical CSS of the second sub page was different to the first
   and as a result was causing a problem…
 * Thus, I was wondering if you can have different critical CSS for different pages…
 * If not, do you think it would be a good idea to simply create a separate header
   file in my theme and manually the critical CSS for the sub page there…
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/jquery-onload-does-not-work/#post-5739806)
 * you, can, using the API. If you’re into that, there’s code in autoptimize_helper.
   php_example that should point you in the right direction 🙂
 * frank

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Jquery Onload does not work…’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

## Tags

 * [function](https://wordpress.org/support/topic-tag/function/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [js](https://wordpress.org/support/topic-tag/js/)
 * [onload](https://wordpress.org/support/topic-tag/onload/)

 * 3 replies
 * 2 participants
 * Last reply from: [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/jquery-onload-does-not-work/#post-5739806)
 * Status: resolved