JavaScript event [removed] not triggered

后端 未结 8 1072
无人及你
无人及你 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:38

    This works for me, i think your problem is somewhere else:

     function resize(){
      var tester = document.getElementById("tester"),
          html = tester.innerHTML
    
      tester.innerHTML = html + "resize 
    " } window.onload = resize; window.onresize = resize;

    you can test it yourself here: http://jsfiddle.net/Dzpeg/2/

    are you sure its the only event called onLoad ? Maybe an other onLoad event creates a conflict

提交回复
热议问题