Cannot read property 'addEventListener' of null Error, not sure why

前端 未结 2 434
误落风尘
误落风尘 2021-01-27 05:16

Whenever I hover over the image it does not enlarge and gives an error.

HTML and Javascript code(these are two separate files):

var banner = document.ge         


        
2条回答
  •  时光取名叫无心
    2021-01-27 06:03

    When referencing the function normalpic, you should preceed it with an empty function:

    banner.addEventListener("mouseout",function(){normalpic},false)
    

提交回复
热议问题