Support » Plugin: Sticky Element » Page Refreshing

  • Resolved chaochipp


    Hi, this plugin is great but may I ask about this code

    $(window).resize(function() {
 = setTimeout(doneResizing, 500);
      function doneResizing(){
        if ($(window).width() != winwidth) {

    This conflicts with other plugins on my page and make the page reloaded every 5s. Could you change this to use other codes more intuitive?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Youdaman


    Hi chaochipp, thanks for pointing this out. It shouldn’t reload the page every 5 seconds, it should only reload it once, and only after a user resizes the browser.

    I’m not sure how to fix the problem you’re having but if you could tell me what other plugins it is conflicting with maybe I can help identify why your page is refreshing every 5 seconds.

    Hi Youdaman,

    Thank you for this awesome bit of code in plugin form!

    I have a quick question to piggy-back on chaochipp’s subject line above: “Would there be a way to not have the page refresh upon resize in general?”

    You know more than I on how all this works but I’ll explain a little.

    We are in development for a “floating” sticky navigation, and building it 100% on your plugin. The inspiration for it comes from the sticky nav which can be seen, for instance, here: As the visitor scrolls down the page, the second navigation sticks to the top and joins them on their scroll.

    However they pulled it off, the page does not refresh upon resize and I would be curious if this is possible/could be made possible somehow with the Sticky Elements plugin.

    I don’t expect your kind, free work to investigate too much. Just wondering if there is something we can do with the plugin to imitate that resizing effect where the Page doesn’t reload every time.

    I also realize the refresh probably has something to do with whether to even show the sticky element or not so it checks the browser window size on each call.

    Thanks again for offering your replies here on this forum, and for the plugin! We are happy either way, whether it’s possible or not 🙂

    Plugin Author Youdaman


    You could add:


    just before the closing body tag in your footer.php — see for a more elaborate example.

    Hi Youdaman – thanks for writing back!

    I pasted what you had above into the footer.php file but wondered what tag to put it in/any code before it, etc.

    Would you be able/willing to write once more and let me know if there are any opening/closing tags needed? I realize this is probably an elementary task but I couldn’t seem to get the result and I wasn’t able to find documentation for it elsewhere.

    If you have the time/a moment and know what’s needed (if anything) I would be grateful and ready to give it a go.

    Thanks again for your reply above!

    PS I did read the StackOverflow article but am afraid I may still be a little lost/unsure when it comes to jquery as I couldn’t seem to achieve the result. Thanks again for the plugin and your time answering our questions here. It is appreciated. 🙂

    Plugin Author Youdaman


    Sorry for the late reply.

    You could add the following before the </body> (end body) tag:


    Thanks, Youdaman – that worked!

    I’m not sure that others would benefit from this “option” but I do appreciate you taking the time to support us in this way.

    Thanks again!

    Plugin Author Youdaman


    No worries 🙂

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Page Refreshing’ is closed to new replies.