samedi 4 juillet 2020

Will CSS position:fixed block event handling?

Show you code first:
https://codesandbox.io/s/vigorous-fog-te1bw?file=/index.html

Please focus on two points:

  1. full-size-bg is full screen background, it use a fixed div to adjust the alpha instead of set background to parent node because I do not want to modify the real image alpha.
  2. scroll-area is above the full-size-bg and it`s(should be) a scrollable area which height is longer than visible area

Then what I want to know is the fixed background will block the event handling if I do not add position: absolute in scroll-area, the scroll area can not scroll with mouse wheel(but it can scroll if use up and down arrow key, Why?). Of course fiexed will leave document flow for layouting, but also for event handling?

Second, Chrome do not need add the z-index line, but Firefox need, Why??

Third, What I need now is a standard way to set a full screen background with alpha programmatically?

Thanks a lot.




Aucun commentaire:

Enregistrer un commentaire