Title: Problem with window.onresize
Last modified: June 14, 2017

---

# Problem with window.onresize

 *  [alesan90](https://wordpress.org/support/users/alesan90/)
 * (@alesan90)
 * [8 years, 12 months ago](https://wordpress.org/support/topic/problem-with-window-onresize/)
 * Hello,
 * First of all thanks for the plugin, it’s awesome!
 * In my site, I need to refresh the whole page every time someone resizes the window.
   The following code worked just fine in doing that:
    `window.onresize = function(){
   location.reload(); }`
 * However, in the pages with a foogallery, the script gets into a loop and keeps
   refreshing the page over and over.
    I thought that maybe when the foogallery 
   is loaded, it somehow resizes the window? To avoid this, I tried waiting for 
   the whole page to load, and used the following code:
 *     ```
       window.onload = function(){
       window.onresize = function(){ location.reload(); }
       };
       ```
   
 * But the problem persists. Could you please help me out?
 * Thanks in advance 🙂

The topic ‘Problem with window.onresize’ is closed to new replies.

 * ![](https://ps.w.org/foogallery/assets/icon-256x256.gif?rev=2602542)
 * [Photo Gallery by FooGallery : Responsive Image Gallery, Masonry Gallery & Carousel](https://wordpress.org/plugins/foogallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/foogallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/foogallery/)
 * [Active Topics](https://wordpress.org/support/plugin/foogallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/foogallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/foogallery/reviews/)

## Tags

 * [resize](https://wordpress.org/support/topic-tag/resize/)

 * 0 replies
 * 1 participant
 * Last reply from: [alesan90](https://wordpress.org/support/users/alesan90/)
 * Last activity: [8 years, 12 months ago](https://wordpress.org/support/topic/problem-with-window-onresize/)
 * Status: not resolved