mirror of
https://github.com/groupe1cir1n/groupe1CIR1Njs.git
synced 2026-03-18 21:40:30 +01:00
rework of zoom functionality
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
<link rel="stylesheet" href="src/css/style.css">
|
||||
<link rel="stylesheet" href="src/css/navbar.css">
|
||||
<link rel="stylesheet" href="src/css/footer.css">
|
||||
<script src="src/js/index/index.js" defer></script>
|
||||
<script type="module" src="src/js/index/index.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="navbar">
|
||||
|
||||
@@ -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 };
|
||||
@@ -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();
|
||||
Reference in New Issue
Block a user