D
D
Develm2015-10-26 17:13:54
JavaScript
Develm, 2015-10-26 17:13:54

How to implement zoom by mouse direction?

Here is a piece of code.

var array = [];
  for (var a = 1; a < 9; a++) { 
    for (var i = 1; i < 6; i++) { 
      var img = new Image();
      img.src="***/max/section"+a+"/"+i+".jpg";
      array[i] = img;
     }
  var canvas = document.getElementById('canvas');
  var context2D = canvas.getContext('2d');
  for (var i = 1; i < array.length; i++) { 
      array[i].onload = function(n){
        context2D.drawImage(array[n],(i-1)*2348,(a-1)*2112,2348,2112);
      }(i);
  }
}

How can I tie zoom?
I wanted through this material, but js is not yet strong.
ask.webatall.com/related.php?id=7258&key=620aHR0cD...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Develm, 2015-10-28
@Develm

https://learn.javascript.ru/mousewheel

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question