Twitter Bootstrap modal opening/closing causes fixed header to jump

后端 未结 14 2420
旧时难觅i
旧时难觅i 2021-01-08 01:39

I am almost done with a simple 2-page website for my registered domain names. Unfortunately I have one small issue I can\'t seem to fix: a jumpy header when a Twitter Bootst

14条回答
  •  庸人自扰
    2021-01-08 01:52

    I seemed to have found a quick fix for my issue. It uses a piece of javascript to add extra style to the header (15px padding-right) to prevent it from jumping. This might not be the best solution but for now it works just fine.

    Since there were no issues on viewports smaller than 768px (mobile) this piece of code only adds the extra 15px to larger viewports such as desktops and laptops

    
    

    If you know a better solution (preferably CSS3 only), please let me know. Thanks for all the help!

提交回复
热议问题