How can I make a background clickable

后端 未结 5 862
萌比男神i
萌比男神i 2020-12-21 08:20

I\'ve been asked to make a sponsored background (site takeover) for one of our sites and the question arose of whether I can make the logos in the tiled background clickable

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-21 08:58

    You'd need to be careful around event order (event capturing vs. bubbling) differences between IE and Mozilla. If you have an element with an onClick event that essentially takes up the entire page, and then other clickable elements on "top" of it, clicking on one of those elements can cause BOTH events to fire, which is likely not the intended functionality.

    PPK explains it better than I can.

提交回复
热议问题