Jquery - Fancybox - Background Page Shift Issue

后端 未结 13 1295
后悔当初
后悔当初 2021-02-02 00:31

Fancybox is loading well and everything opens as I want it to, but the issue occurs in the background-- it\'s visible (and disturbing) that my entire page shifts exactly 8 pixel

13条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-02 00:51

    I used fancybox v.2.1.4 with a fixed, centered background image for the body, and forcing vertical scrollbar to always showing.

    body{
      background: url('../img/sfondo.jpg') fixed center top;
      overflow-y: scroll;
    }
    

    Despite having forced the display of scrollbar, I had the background-image shift problem with firefox on mac (chrome and safari were ok since lion scrollbars don't take space inside the page) and ie,ff,chrome on windows.

    So I noticed that if I manually set the x-offset instead of the world center on the background property the issue was gone, so I managed it with a little of jquery in the HEAD of the page:

    
    

提交回复
热议问题