Updated  (function($, window, document) {

(function($, window, document) {

})(jQuery, window, document);

Wrap your JS in this instead of using $(document).ready()