JavaScript event [removed] not triggered

后端 未结 8 1042
无人及你
无人及你 2021-02-01 01:15

I\'ve got the following code in a website:

 window.onload = resize;
 window.onresize = resize;

 function resize(){
  heightWithoutHeader = (window.innerHeight -         


        
相关标签:
8条回答
  • 2021-02-01 01:57

    I think what's probably happening here is that your window.onload is being overridden later, check to make sure that it's not via things like <body onload="">

    You can check this by alert(window.onload) in your re-size function, to see what's actually attached there.

    0 讨论(0)
  • 2021-02-01 01:59

    This will be work when you call the "window.onload" next to the function resize()

    0 讨论(0)
提交回复
热议问题