0

Having this issue everytime I try to access the .style property. This happens everytime I try to modify the CSS properties using .style in javascript.

code.js:9 Uncaught TypeError: Cannot read property 'style' of undefined at HTMLImageElement.

for(var i = 0; i<description.length;i++) {
  image[i].addEventListener("mouseover", function() {
    description[i].style.visibility = visible;
    description[i].style.opacity = 0;
    var last = +new Date();
    var tick = function() {
      description[i].style.opacity = +description[i].style.opacity + (new Date() - last)/700;
      last = +new Date();

      if (+description[i].style.opacity < 1) {
        (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);
      }
    };

    tick();
  });
}
Commercial Suicide
  • 14,875
  • 14
  • 62
  • 80
John A
  • 63
  • 3
  • 11

0 Answers0