i know i'm 2 years late to this video, but i coded an area underneath the pop-up images where a title, date and description would appear, pulling from the hidden h4 and p tags in the square with the id function problem is, i can only have the title and description of the first image appear, and it'll display that same title and description under all the images i was wondering if there's a certain way to have it so that the title and description changes independently for each image?
Thank you for your tutorial it worked like a charm! I don't want to bother but do you know how to add caption for every image in the popup view? I'm trying to use figcaption to pass through the .popup-image but I'm not getting it. I also made a Stack Overflow's post but they marked as a duplicate (and the marked previously post didn't respond my question). Please if you could help me I'd be so glad.
@@fernandoaguirre8359 cuando visualizas la imagen te sale el boton de cerrar si no es asi valida esta linea de codigo × dentro del si te sale el boton pero no te funciona valida el js diractamente en el evento onclick del span si no es eso enviame el codigo y miramos
Can you follow this tutorial step by step, so you can understand it. He make this video with effort to share the knowledge to other people. Not to the people like you who want copy paste it for no shame at all.
@@candrasniper3404 its not copy paste ,i understand the code he written iam software engineering ,but instead of rewrite something i understood it ,put link code will be so helpful for people
Awesome and very efficiently explained. This was exactly the video I was looking for. Thanks a ton for the help. Subscribed happily!
Glad it helped!
Nice; however, I‘d like to also see the prev and next ARROWS, especially for mobile devices.
by the way, doea it adapt? like every picture sizes, gets the same size, and can it hold around 50 pictures?
Simple Easy Fast Forward... so nice tutorial
after refreshing or reloading the popup image is not collapsing...
exclente vidio, it´s so usefull, sorry for mi writing im from argentina
tremendo muchas gracias
💥💯💥💯💥💯💥💯awesome
It's beautiful Mr. Web Designer. Very well explained e easy entendment. Please continue in the videos!!
Thanks and sucess ever
i know i'm 2 years late to this video, but i coded an area underneath the pop-up images where a title, date and description would appear, pulling from the hidden h4 and p tags in the square with the id function
problem is, i can only have the title and description of the first image appear, and it'll display that same title and description under all the images
i was wondering if there's a certain way to have it so that the title and description changes independently for each image?
This video very help ful for...😍😍🔥
Cool man!! I'm stuck with a circular gallery but this video really opens my a path 👌
How to use this method to view specific product details of ecommerce website?
From unsplash website at what resolution we have to download for image gallery
Helped a lot....thank you so much
Thank you! Very helpful, subbed!
Awesome, thank you!
Thank you for your tutorial it worked like a charm!
I don't want to bother but do you know how to add caption for every image in the popup view? I'm trying to use figcaption to pass through the .popup-image but I'm not getting it. I also made a Stack Overflow's post but they marked as a duplicate (and the marked previously post didn't respond my question).
Please if you could help me I'd be so glad.
great vid mate
Very efficiently explained. Thanks for help, Subscribed❣
Glad it was helpful!
fantastic 😊
Here is a new request for upcoming video: make a pop up image viewer with next and previous img button using css, vanilla js
Nice one again, keep it up
Thank you, it allowed me to understand and to adapt the code to my website.🛠
Glad it helped!
Awesome 😃
Thanks very much for this video. Awesome
My pleasure!
Why wont my x button work when an image pops up i cant find the error? i placed it on a section of the website
Thanks for this video🥰
You’re welcome 😊
excellent!
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.container {
position: relative;
min-height: 100vh;
background: white;
}
.container .image-container {
display: flex;
flex-wrap: wrap;
gap: 15px;
justify-content: center;
padding: 10px;
}
.container .image-container .image {
height: 250px;
width: 350px;
border: 10px solid white;
box-shadow: 0 5px 15px black;
overflow: hidden;
cursor: pointer;
}
.container .image-container .image img {
height: 100%;
width: 100%;
object-fit: cover;
transition: 0.2s linear;
}
.container .image-container .image:hover img {
transform: scale(1.1);
}
.container .popup-image {
position: fixed;
top: 0;
left: 0;
background: black;
height: 100%;
width: 100%;
z-index: 100;
display: none;
}
.container .popup-image span {
position: absolute;
top: 0;
right: 10px;
font-size: 40px;
font-weight: bolder;
color: white;
cursor: pointer;
z-index: 100;
}
.container .popup-image img {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border: 5px solid white;
border-radius: 5px;
width: 750px;
object-fit: cover;
}
@media (max-width: 768px) {
.container .popup-image img {
width: 95%;
}
}
×
document.querySelectorAll(".image img").forEach(image => {
image.onclick = () => {
document.querySelector(".popup-image").style.display = "block";
document.querySelector(".popup-image img").src =
image.getAttribute("src");
};
});
document.querySelector(".popup-image span").onclick = () => {
document.querySelector(".popup-image").style.display = "none";
};
Code!!
Life saver
You're awesome! Thank you very very much!!
perfect ♥
How can I add captions with every image when it pos-open?
Any idea why its moving all my images to the right when it pops up ?
I want to write descriptions at the pop up images,how do l do it
Nice
Thanks
Thank you for this!
How can i make the images swap with the keyboard arrows?
you have to use swiper.js library then!
Life saver.
Fantastic. Good guide, ty.
Glad it was helpful!
It seem every time I load the page it will automatically show the popup image, is there something I' missed
👌☘
thanks for this amazing tutorial
thank you so much good code;
Nice,
bro... how you make the cross icon without any i tag
You are using which code editor?
vs code editor
what editor did you use?
vs code editor
@@MrWebDesignerAnas can you drop down the source code
this what i looking forrrr
Thank you SO SO SO SO much ❤️
You're so welcome!
help!! I cant close de popup image with cross! i cant find the error. i have to use some script to use this code? Help!!!!!
check your javascript code!
@@MrWebDesignerAnas its the same! I have to use some script to make it works? I didnt see in the video. Can i try changing classes names?
great video, thanks
You are welcome!
thank youuu!!
Can you help me? the exit button on my image is not showing, how to fix?
did you use position property for exit button and zindex as well?
@@MrWebDesignerAnas how? what should i put?
use this code for close button :
position:absolute;
top:20px; right:20px;
and position:relative; for its parent element
did I do it right? (empty img srcs)
* {
margin:0; padding:0;
box-sizing: border-box;
}
.container{
position: relative;
min-height: 100vh;
background: white;
}
.container .image-container{
display: flex;
flex-wrap: wrap;
gap:15px;
justify-content: center;
padding: 10px;
}
.container .image-container .image{
height: 250px;
width: 350px;
border:10px solid white;
box-shadow: 0 5px 15px black;
overflow:hidden;
cursor: pointer;
}
.container .image-container .image img{
height:100%;
width:100%;
object-fit: cover;
transition: .2s linear;
}
.container .image-container .image:hover img{
transform: scale(1.1);
}
.container .popup-image{
position: fixed;
top:0; left:0;
background: black;
height:100%;
width:100%;
z-index:100
}
.container .popup-image span{
position: absolute;
top:0; right:10px;
font-size: 40px;
font-weight: bolder;
color: white;
cursor: pointer;
z-index: 100;
}
.container .popup-image img{
position: absolute;
top: 50%; left:50%;
transform: translate(-50%, -50%);
border:5px solid white;
border-radius: 5px;
width:750px;
object-fit: cover;
}
@media (max-width:768px){
.container .popup-image img{
width:95%;
}
×
document.queryselectorall('.image-container img').foreach(image =>{
image.onclick = () =>{}
document.queryselector('.popup-image').style.display = 'block';
document.queryselector('.popup-image img').src = image.getattribute('src');
}
});
document.queryselector('popup-image span').onclick = () =>{
document.queryselector('.popup-image').style.display = 'none';
}
You is the GOAT !!! Thank you very very very very very very very very much !
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.container {
position: relative;
min-height: 100vh;
background: white;
}
.container .image-container {
display: flex;
flex-wrap: wrap;
gap: 15px;
justify-content: center;
padding: 10px;
}
.container .image-container .image {
height: 250px;
width: 350px;
border: 10px solid white;
box-shadow: 0 5px 15px black;
overflow: hidden;
cursor: pointer;
}
.container .image-container .image img {
height: 100%;
width: 100%;
object-fit: cover;
transition: 0.2s linear;
}
.container .image-container .image:hover img {
transform: scale(1.1);
}
.container .popup-image {
position: fixed;
top: 0;
left: 0;
background: black;
height: 100%;
width: 100%;
z-index: 100;
display: none;
}
.container .popup-image span {
position: absolute;
top: 0;
right: 10px;
font-size: 40px;
font-weight: bolder;
color: white;
cursor: pointer;
z-index: 100;
}
.container .popup-image img {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border: 5px solid white;
border-radius: 5px;
width: 750px;
object-fit: cover;
}
@media (max-width: 768px) {
.container .popup-image img {
width: 95%;
}
}
×
document.querySelectorAll(".image img").forEach(image => {
image.onclick = () => {
document.querySelector(".popup-image").style.display = "block";
document.querySelector(".popup-image img").src =
image.getAttribute("src");
};
});
document.querySelector(".popup-image span").onclick = () => {
document.querySelector(".popup-image").style.display = "none";
};
Corrected Code...!!
@@manastewari311 THANK YOU VERRY MUCH!!!!!!!!!!!!! I needed it for my project thank you very much
Thanx a lot!!
thank you very much, still have some issue to ADDRESS
thanks a lot!
i like it
How to add "view more images" below the gallery?
might this help you : th-cam.com/video/4UZdSp9PMI4/w-d-xo.html
Bro how to create fab icon on bottom corner when scroll down example: icon with text when scroll down only icon will be appear in bottom corner
Where do I call the Java script function?
you can create a different file for javascript or you can write javascript at the bottom before the closing of body tag in html file!
@@MrWebDesignerAnas thankyou it's working now turns out I did not select the query
why every i refresh the web the popup image always show?
you the evenListener 'click' for each videos
@@MrWebDesignerAnas what do you mean? you didn't use evenListener... I have the same problem with the default image
When I click on the 2nd image the 1st image popup shows up anyone else have this issue ?
Hello! My cross don't work.. I create this, but my X don't close the image 😟
did you write the exact code in the tutorial? or gave the exact class / id name in the javascript?
@@MrWebDesignerAnas Yes i did and i have the same problem.
gracias bro
plz attach your github with your videos ...
and make public repo ...
thanks man
why that popup is showed when I refresh my webpage
Thank you :)
You're welcome!
Thanks
Sorry man but the Js isn't working in my code
puedes pasarme el codigo!
i want with indicator right and left
I want the source code is avaiable....
How to add download button,
This download button should be every image bottom.
how do i download source code?
Hi, Mr. Shaikh Anas. I would like to have the code please. Could you please upload it to buy me a coffee?
saludos buen video como podría agregarle texto a cada imagen a la hora de visualizar el popup
no puedo cerrar la imagen dle popup, tengo que refrescar la pagina, sabes como repararlo?
@@fernandoaguirre8359 cuando visualizas la imagen te sale el boton de cerrar si no es asi valida esta linea de codigo × dentro del si te sale el boton pero no te funciona valida el js diractamente en el evento onclick del span
si no es eso enviame el codigo y miramos
@@gustavogarces3454 te paso el script:
document.querySelectorAll('.image-container img').forEach(image=>{image.onclick = () =>
{document.querySelector('.popup-image').style.display= 'block';
document.querySelector('.popup-image img').src = image.getAttribute('src');
}});
document.querySelector('.poppup-image span').onclick = () =>{document.querySelector('.popup-image').style.display = 'none';
}
@@fernandoaguirre8359 valida ("poppup-image" es diferente de popup-image") estas llamando el evento onclick a una clase con otro nombre valida eso.
great!code pls
Can you give us the source code?
Can you follow this tutorial step by step, so you can understand it. He make this video with effort to share the knowledge to other people. Not to the people like you who want copy paste it for no shame at all.
Github link😢 needed its called reuse
@@candrasniper3404 its not copy paste ,i understand the code he written iam software engineering ,but instead of rewrite something i understood it ,put link code will be so helpful for people
the java script did not work
Pop up not working
code please
code?
source codes?
in the description!
pls source code
This video source code upload please
don't work
code please😅😅😅
vulu ... ocay ...
thanks