HTML Image Zoom on Click using JavaScript

preview_player
Показать описание
In this video, I will show you how to make zoom-in and zoom-out effects using HTML, CSS, and JavaScript.
After watching this video you will be able to change the class of images to become bigger as you click on the image, and when you click on it again, it should become smaller.

#javascript #html #tutorial
Рекомендации по теме
Комментарии
Автор

Thank you for this short but right-to-the-point and useful tutorial!

anahitarahimi
Автор

thanks dude, it really help me a lot 🔥

zyalwfie
Автор

Whereabouts are your picture filenames?
I don't see any picture file extensions.

ACEinOZ
Автор

wow what a great video you r a saviour!!!

clumsymisslittle
Автор

This was super helpful thank you!!! Is there anyway to make it so only one image pops out at a time and resets when another image is clicked? I tried this out and when I click on multiple images they all start to stack. 😅

yaristarry
Автор

Can the complete code be shown so someone like me with only basic knowledge about html is able to zoom-in on pics on a webpage?
If so...thank-you!! :)

ACEinOZ
Автор

That's what I was looking for, tks man!

amauriblanco
Автор

Here is the full code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.images {
width: 100px;
height: 100px;
}

body {
background-color: rgb(235, 233, 233);
}
.fullsize {
border: 5px solid greenyellow;
z-index: 999;
cursor: zoom-out;
display: block;
width: 400px;
max-width: 400px;
height: 400px;
position: fixed;
left: 100;
top: 30px;
}
</style>
</head>
<body>
<h1>Click Zoom Image</h1>
<div id="gallery">
<img src="donut1.jpg" class="images" onclick="change(this)">
<img src="donut2.jpg" class="images" onclick="change(this)">
<img src="donut3.jpg" class="images" onclick="change(this)">


</div>
<script>
function change(element) {

}
</script>
</body>
</html>

TheWheelchairGuy
visit shbcf.ru