• Resolved michalrama

    (@michalrama)


    Hello,

    I am solving a header problem. If I set it as “sticky”, then its width does not change when the browser width is changed. However, if I reload the page, it now displays correctly.

    In theory I could do this with JS so that it loads itself when the width changes.

    jQuery(window).resize(function() {
        location.reload();
    });

    This code works. Unfortunately, there are two problems

    1. It is done with a considerable delay (about 1.5 seconds which is noticeable)
    2. And most importantly, by reloading the page as quickly as possible, it will “flash”.

    Would it be possible to reload just the element using AJAX?

    Please help

    Thank you

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Do away with all that JavaScript stuff. What you want to achieve, you can also solve with pure CSS. Just add

    header#masthead {
     position: sticky;
     top: 0;
     left: 0;
     right: 0;
     z-index: 10000;
    }
    Thread Starter michalrama

    (@michalrama)

    Hello @threadi

    This is exactly what I wanted.

    Thank you very much and sorry for the late reply.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Is it possible to reload only the element and not the whole page?’ is closed to new replies.