hey GUYS, here is the script to disable the video from playing in the background document.querySelectorAll('.video-container video').forEach(vid => { vid.onclick = () =>{ document.querySelector('.popup-video').style.display = 'block'; document.querySelector('.popup-video video').src = vid.getAttribute('src'); } }); document.querySelector('.popup-video span').onclick = () => { document.querySelector('.popup-video').style.display = 'none'; document.querySelector('.popup-video video').pause(); // add this code }
Awesome tutorial. I really appreciated this. Question : How would you go about making it so after you open the video, you can click anywhere outside of the video to close it as opposed to only clicking the X to escape?
I loved the video, sorry, an error occurs to me, I can't close the video, the X doesn't work. I am using , but it doesn't close the videos. Could you help me please.🥺
great tutorial! unfortunately videos hosted on youtube dont allow for direct access to their mp4 link. Do you know how i can design something like this but with the youtube embedded player?
I tried your code but the foreach code in the Java script is not working, same video will popup even when I clicked the other one, then if I clicked the X button the video will still play
Why is it so hard to share the source code? It literally takes 2 seconds compared to all the time you spent recording yourself coding and uploading this video.
Thankyou for your great video Mr Web Designer, just what I am looking for. Could you PLEASE help me with the close button of the popup not stopping the audio from playing after closing. I note your earlier reply of using closeVideo.onclick = () =>{ mainVideo.pause(); } I have tried to add this to the code but not having any luck. Can you please advise the line number and is it in the INDEX or CSS file and the exact code and where to put this code to make this work. Thankyou for your help in advance.🙂
hey here is the script to disable the video from playing in the background document.querySelectorAll('.video-container video').forEach(vid => { vid.onclick = () =>{ document.querySelector('.popup-video').style.display = 'block'; document.querySelector('.popup-video video').src = vid.getAttribute('src'); } }); document.querySelector('.popup-video span').onclick = () => { document.querySelector('.popup-video').style.display = 'none'; document.querySelector('.popup-video video').pause(); // add this code }
@@hammad4513 I think its just something on your code. Just check it line after line, word after word. I will send you my entire CSS code as well and the container markup.
@@MrWebDesignerAnas Fantastic video....just what I am looking for, I do not have a lot of experience with coding....I am having the same problem as Esther above, and I am not sure where to put the code you have suggested. Can you please elaborate and advise the line number on either the CSS or INDEX file and exact code that I need to use to make this work. Your help is most greatly appreciated. Thanks for helping everyone with the services you provide. Many thanks.🙂
@@MrWebDesignerAnas can I please have the current version? I need it for your Tour and Travel website as soon as possible please! Please let me know how I can get in touch with you as I need further help editing and developing the website. I can pay and requirements
Hi, thanks for the tutorial!! When i click on a video it pops up but without showing the video, only a gray rectangle, and it only plays the small sized one.
one like for splendid work.. because of this i got alot of help in my project...
Thankyou very very much, I was stuck in this for days. ❤❤❤
Thank you a lot. You helped to solve my problem! God bless you 🙏
welcome!
hey GUYS, here is the script to disable the video from playing in the background
document.querySelectorAll('.video-container video').forEach(vid => {
vid.onclick = () =>{
document.querySelector('.popup-video').style.display = 'block';
document.querySelector('.popup-video video').src = vid.getAttribute('src');
}
});
document.querySelector('.popup-video span').onclick = () => {
document.querySelector('.popup-video').style.display = 'none';
document.querySelector('.popup-video video').pause(); // add this code
}
Thanks! You are a hero S2
Thank you!!!
Gracias! Obrigado! Thanks you! Arigato!🤗🤗🤗🤗🤗🤗
big W
thank you
much loooove ❤❤❤❤
Wonderful so educational
Thank you for porviding this tutorial and many others on your channel. Appreciated
Awesome tutorial. I really appreciated this. Question : How would you go about making it so after you open the video, you can click anywhere outside of the video to close it as opposed to only clicking the X to escape?
Thanks For Tutor Sir
Your videos are really awesome 🔥.
Thank you my bro
thank you so much
you're really fanstatic
Great😎
boss you are great❤
so cool bro, tks
It would be nice if you give the direct source codes. Our goal is just to add it to our site quickly and easily.
agree @Mr. Web Designer
Nice Video! How can I pause the music after closing the video when working with ? I embedded a video from TH-cam
Yes. I cant. How can I pause the music ??
@@furkanesen8429 hocam çözdün mü ya kafayı yedim çözemedim
can you put like text or descriptions on each class or of what you are doing
👽😍😍
works great but when i closed the popup video. the sound is still playing in the background.
yes yes yes, could you fix the problem????
Really cool video. I have a question: Can we use this method work with youtube videos?
Yes you can!
when i m click on any image to play video, video is playing but left side bottom position not playing like u show in popup in centre, plz help me
When I click on the video to see it in the popup, the src is not updated according to the video but stays at "null" do you know what I can do?
ty
I don't know how to thank you 😍
😍😍😍
I loved the video, sorry, an error occurs to me, I can't close the video, the X doesn't work.
I am using , but it doesn't close the videos.
Could you help me please.🥺
write the exact javascript code as shown in the video with exact classes name and tags
Assalamualaikum
Brothers e-commerce product image description hiden
Main image on click after open description
Please reply
HI, Great tutorials.
How to add titles and tags with same responsive design ?
Thanks
might this help you : th-cam.com/video/YZLuBdYgDsA/w-d-xo.html
how do i add border to the span? I set the background as white, so that the border is no really visible
hi my video is working fine but after closing the video the sound is still playing how to fix this?
are you using opacity:0 or display:none property to hide video?
@@MrWebDesignerAnas Thanks for an excellent video. Using display: none in javascript
@@MrWebDesignerAnas same issue, I did exactly what you did
How to upload new post this site.
this is the advance version of this video but you can upload it from here :
th-cam.com/video/wvu37Ze0HmE/w-d-xo.html
Thank you!
But I have a question, how can I add a title under the video?
Is there a contact to ask?
how to upload wizard ??? Please tutorials
काय विडीयो बनवलेत हो खूपच छान 🙏
Sir all video name kye ahet ho sangal kye mala
????
@@MrWebDesignerAnas
Sir mala tumhi video download kele tyanche name sanga sir
great tutorial! unfortunately videos hosted on youtube dont allow for direct access to their mp4 link. Do you know how i can design something like this but with the youtube embedded player?
It's best to use an to do that
I tried your code but the foreach code in the Java script is not working, same video will popup even when I clicked the other one, then if I clicked the X button the video will still play
const video = document.querySelectorAll(".video-container video");
const popup = document.querySelector(".popup-video");
const popupVideo = document.querySelector(".popup-video video");
const close = document.querySelector(".popup-video span");
video.forEach((vid) => {
vid.onclick = () => {
popup.style.display = "block";
popupVideo.src = vid.getAttribute("src");
};
});
close.onclick = () => {
popup.style.display = "none";
popupVideo.pause();
popupVideo.currentTime=0;
};
@@dinai342 I already figured it out last year
Why is it so hard to share the source code? It literally takes 2 seconds compared to all the time you spent recording yourself coding and uploading this video.
Thankyou for your great video Mr Web Designer, just what I am looking for.
Could you PLEASE help me with the close button of the popup not stopping the audio from playing after closing.
I note your earlier reply of using
closeVideo.onclick = () =>{
mainVideo.pause();
}
I have tried to add this to the code but not having any luck. Can you please advise the line number and is it in the INDEX or CSS file and the exact code and where to put this code to make this work.
Thankyou for your help in advance.🙂
hey here is the script to disable the video from playing in the background
document.querySelectorAll('.video-container video').forEach(vid => {
vid.onclick = () =>{
document.querySelector('.popup-video').style.display = 'block';
document.querySelector('.popup-video video').src = vid.getAttribute('src');
}
});
document.querySelector('.popup-video span').onclick = () => {
document.querySelector('.popup-video').style.display = 'none';
document.querySelector('.popup-video video').pause(); // add this code
}
@@DaudiNungwana Need One More Help Bro... As I Am Refershing The Page It Showing Video Again Without Clicking On It..
@@hammad4513 I think its just something on your code. Just check it line after line, word after word. I will send you my entire CSS code as well and the container markup.
@@DaudiNungwana Thankyou so much for your help....all fixed and working just fine. Thanks again
@@together-goodstuffhappens8205 glad I was of help.
where is the audio for description?
Ive gotten everything on this perfect but the span x button wont close the pop up video, i dont know what im doing wrong
check the javascript code! the classname should be correct
please share the code..
hey sir, great video! after closing the video, it doesn't pause. can you type the pause command here? thanks!!!
closeVideo.onclick = () =>{
mainVideo.pause();
}
@@MrWebDesignerAnas Fantastic video....just what I am looking for, I do not have a lot of experience with coding....I am having the same problem as Esther above, and I am not sure where to put the code you have suggested. Can you please elaborate and advise the line number on either the CSS or INDEX file and exact code that I need to use to make this work. Your help is most greatly appreciated. Thanks for helping everyone with the services you provide. Many thanks.🙂
@@MrWebDesignerAnas where should I place this code sir
The only way that it works for me:
document.addEventListener('DOMContentLoaded', () => {
const videos = document.querySelectorAll('.video-container video');
const holder = document.querySelector('.popup-video video');
videos.forEach (vid => {
vid.onclick = function( el) {
let src = el.target.getAttribute('src');
holder.setAttribute('src', src);
document.querySelector('.popup-video').style.display = 'block';
}
});
document.querySelector('.popup-video span').onclick = () => {
const mdsrc = document.querySelector('.popup-video video');
mdsrc.pause();
mdsrc.currentTime = 0;
document.querySelector('.popup-video').style.display = 'none';
}
});
bro why you dont copy the full code somewhere you dont explain what you are doing anyway
js is not working...plz help
Source code please
it`s possible to create this popup with s?
yeah sure!
@@MrWebDesignerAnas i've tried replacing the "video" tags with "" but the popup doesn't open when clicking the videos.
Sourse code please
could you please upload the code to buy a coffee?
I'll try to make even a better version of this code in the future and provide it for free
@@MrWebDesignerAnas can I please have the current version? I need it for your Tour and Travel website as soon as possible please! Please let me know how I can get in touch with you as I need further help editing and developing the website. I can pay and requirements
Hi, thanks for the tutorial!! When i click on a video it pops up but without showing the video, only a gray rectangle, and it only plays the small sized one.
did you write the exact code shown in the descriptions?
@@MrWebDesignerAnas yes, i even rewrote it a couple of times to make sure it was exactly the same..
Now its working! but when i close the popup video with the X the audio keeps playing without the video.
@@salvaravens use a javascript function called paused() on video selector in javascript!
@@MrWebDesignerAnas after trying several times, it worked!! thanks!!!
Konse theme hai ye vs code me
leatus dark theme
can you give source/
Upload here the code Bro🙏😍
Pls give code
source code please
in the description if not found there's an another video gallery website with source code
vola ... ocay ...