diff --git a/index.html b/index.html
index de78ce0..44e9afd 100644
--- a/index.html
+++ b/index.html
@@ -8,7 +8,7 @@
-
+
diff --git a/src/js/index/index.js b/src/js/index/index.js
index 48b022f..ceca63d 100644
--- a/src/js/index/index.js
+++ b/src/js/index/index.js
@@ -1,10 +1,8 @@
-
-var imgAnalyse = document.getElementById("img_analyse");
-
function zoom(img){
- img.setAtribute("width", "width*2px")
- img.setAtribute("height", "height*2px")
+ var width = parseInt(img.getAttribute("width"));
+ var height = parseInt(img.getAttribute("height"));
+ img.setAttribute("width", width * 2)
+ img.setAttribute("height", height * 2)
}
-addEventListener("mouseover", zoom(imgAnalyse));
-
+export { zoom };
\ No newline at end of file
diff --git a/src/js/index/main.js b/src/js/index/main.js
index d825f3a..474008b 100644
--- a/src/js/index/main.js
+++ b/src/js/index/main.js
@@ -1,6 +1,11 @@
+import { zoom } from "./index.js";
+
function main() {
- zoom();
- addEventListener("mouseover", zoom(imgAnalyse));
+ var imgAnalyse = document.getElementById("img_analyse");
+ zoom(imgAnalyse);
+ imgAnalyse.addEventListener("mouseover", function() {
+ zoom(imgAnalyse);
+ });
}
main();
\ No newline at end of file