No video

Create A Responsive Popup Video Gallery Using HTML CSS And Vanilla Javascript

  Рет қаралды 50,797

Mr. Web Designer

Mr. Web Designer

Күн бұрын

how to make a simple responsive lightbox video gallery using html css and vanilla javascript.
create a video popup gallery on click using vanilla javascript.
videos are from pixabay:
pixabay.com/vi...
New To My Channel Subscribe Now And See More Stuff Like This:
/ @mrwebdesigneranas
#ImageGallery
#LightboxGallery
#Javascript

Пікірлер: 104
@gamermafiabeast786
@gamermafiabeast786 Ай бұрын
Thankyou very very much, I was stuck in this for days. ❤❤❤
@DaudiNungwana
@DaudiNungwana Жыл бұрын
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 }
@phaews
@phaews Жыл бұрын
Thanks! You are a hero S2
@user-mj5hb7ux3f
@user-mj5hb7ux3f Жыл бұрын
Thank you!!!
@claucad52
@claucad52 Жыл бұрын
Gracias! Obrigado! Thanks you! Arigato!🤗🤗🤗🤗🤗🤗
@hadinazar367
@hadinazar367 9 ай бұрын
big W
@therockinist9586
@therockinist9586 6 ай бұрын
thank you
@vikrambais4885
@vikrambais4885 Жыл бұрын
one like for splendid work.. because of this i got alot of help in my project...
@naugustus939
@naugustus939 Жыл бұрын
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?
@ozodbekboriboyev1010
@ozodbekboriboyev1010 2 жыл бұрын
Thank you a lot. You helped to solve my problem! God bless you 🙏
@MrWebDesignerAnas
@MrWebDesignerAnas 2 жыл бұрын
welcome!
@exodusmediasg
@exodusmediasg 2 жыл бұрын
Thank you for porviding this tutorial and many others on your channel. Appreciated
@renkselalbumtasarm3597
@renkselalbumtasarm3597 2 жыл бұрын
It would be nice if you give the direct source codes. Our goal is just to add it to our site quickly and easily.
@moobonhoe8566
@moobonhoe8566 2 жыл бұрын
agree @Mr. Web Designer
@jnd6807
@jnd6807 2 жыл бұрын
Wonderful so educational
@jackotex6205
@jackotex6205 Жыл бұрын
Nice Video! How can I pause the music after closing the video when working with ? I embedded a video from KZfaq
@furkanesen8429
@furkanesen8429 Жыл бұрын
Yes. I cant. How can I pause the music ??
@yusufsabr2288
@yusufsabr2288 Жыл бұрын
@@furkanesen8429 hocam çözdün mü ya kafayı yedim çözemedim
@aichan8730
@aichan8730 10 ай бұрын
much loooove ❤❤❤❤
@karnatakashushma4788
@karnatakashushma4788 3 жыл бұрын
Your videos are really awesome 🔥.
@fajarsaputra4si502
@fajarsaputra4si502 Жыл бұрын
Thanks For Tutor Sir
@ZUOSLP
@ZUOSLP 2 жыл бұрын
Really cool video. I have a question: Can we use this method work with youtube videos?
@MrWebDesignerAnas
@MrWebDesignerAnas 2 жыл бұрын
Yes you can!
@ritikasaini629
@ritikasaini629 3 жыл бұрын
Great😎
@edbertcadavero14
@edbertcadavero14 Жыл бұрын
works great but when i closed the popup video. the sound is still playing in the background.
@yusufsabr2288
@yusufsabr2288 Жыл бұрын
yes yes yes, could you fix the problem????
@bekisahmet2326
@bekisahmet2326 6 ай бұрын
thank you so much
@user-bx3gm4xc6p
@user-bx3gm4xc6p Жыл бұрын
Thank you my bro
@sumondatta3440
@sumondatta3440 2 жыл бұрын
boss you are great❤
@trunglekien8217
@trunglekien8217 3 жыл бұрын
you're really fanstatic
@thinguyeninh2028
@thinguyeninh2028 3 жыл бұрын
so cool bro, tks
@DreysyPG
@DreysyPG 2 жыл бұрын
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.🥺
@MrWebDesignerAnas
@MrWebDesignerAnas 2 жыл бұрын
write the exact javascript code as shown in the video with exact classes name and tags
@together-goodstuffhappens8205
@together-goodstuffhappens8205 2 жыл бұрын
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.🙂
@DaudiNungwana
@DaudiNungwana Жыл бұрын
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
@hammad4513 Жыл бұрын
@@DaudiNungwana Need One More Help Bro... As I Am Refershing The Page It Showing Video Again Without Clicking On It..
@DaudiNungwana
@DaudiNungwana Жыл бұрын
@@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.
@together-goodstuffhappens8205
@together-goodstuffhappens8205 Жыл бұрын
@@DaudiNungwana Thankyou so much for your help....all fixed and working just fine. Thanks again
@DaudiNungwana
@DaudiNungwana Жыл бұрын
@@together-goodstuffhappens8205 glad I was of help.
@Axel-Ehh
@Axel-Ehh 3 ай бұрын
can you put like text or descriptions on each class or of what you are doing
@MrAkalp
@MrAkalp 5 ай бұрын
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
@snaqvi009
@snaqvi009 2 жыл бұрын
HI, Great tutorials. How to add titles and tags with same responsive design ? Thanks
@MrWebDesignerAnas
@MrWebDesignerAnas 2 жыл бұрын
might this help you : kzfaq.info/get/bejne/j8B8qKWVvs2oo3U.html
@BuffaloBlack
@BuffaloBlack Жыл бұрын
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.
@thomdraw7933
@thomdraw7933 Жыл бұрын
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?
@sabrinasung1618
@sabrinasung1618 2 жыл бұрын
hi my video is working fine but after closing the video the sound is still playing how to fix this?
@MrWebDesignerAnas
@MrWebDesignerAnas 2 жыл бұрын
are you using opacity:0 or display:none property to hide video?
@aldrichgaming3071
@aldrichgaming3071 2 жыл бұрын
@@MrWebDesignerAnas Thanks for an excellent video. Using display: none in javascript
@justein2334
@justein2334 2 жыл бұрын
@@MrWebDesignerAnas same issue, I did exactly what you did
@FidelEmilioSusanaJimenez
@FidelEmilioSusanaJimenez Жыл бұрын
👽😍😍
@aniketashokbhise
@aniketashokbhise 3 жыл бұрын
😍😍😍
@ideiasderendaextraoficial
@ideiasderendaextraoficial 2 жыл бұрын
ty
@superAbtruse503
@superAbtruse503 3 жыл бұрын
how do i add border to the span? I set the background as white, so that the border is no really visible
@sangarstudio6435
@sangarstudio6435 2 жыл бұрын
I don't know how to thank you 😍
@Raidoven
@Raidoven Жыл бұрын
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?
@Ro_V_oR
@Ro_V_oR 9 ай бұрын
It's best to use an to do that
@michaeljohnaprahamian4346
@michaeljohnaprahamian4346 Жыл бұрын
Ive gotten everything on this perfect but the span x button wont close the pop up video, i dont know what im doing wrong
@MrWebDesignerAnas
@MrWebDesignerAnas Жыл бұрын
check the javascript code! the classname should be correct
@gousiyaart2515
@gousiyaart2515 3 жыл бұрын
Assalamualaikum Brothers e-commerce product image description hiden Main image on click after open description Please reply
@benjamindame3879
@benjamindame3879 Жыл бұрын
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
@dinai342
@dinai342 Жыл бұрын
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; };
@benjamindame3879
@benjamindame3879 Жыл бұрын
@@dinai342 I already figured it out last year
@invisibletechnician8732
@invisibletechnician8732 Жыл бұрын
How to upload new post this site.
@MrWebDesignerAnas
@MrWebDesignerAnas Жыл бұрын
this is the advance version of this video but you can upload it from here : kzfaq.info/get/bejne/rdylZpqLypasnXk.html
@FarbilGaming
@FarbilGaming Жыл бұрын
Thank you! But I have a question, how can I add a title under the video?
@FarbilGaming
@FarbilGaming Жыл бұрын
Is there a contact to ask?
@bimaltwayana2058
@bimaltwayana2058 2 жыл бұрын
please share the code..
@apnacoding3798
@apnacoding3798 Жыл бұрын
काय विडीयो बनवलेत हो खूपच छान 🙏 Sir all video name kye ahet ho sangal kye mala
@MrWebDesignerAnas
@MrWebDesignerAnas Жыл бұрын
????
@apnacoding3798
@apnacoding3798 Жыл бұрын
@@MrWebDesignerAnas Sir mala tumhi video download kele tyanche name sanga sir
@VicenteCarlosFernandes
@VicenteCarlosFernandes 7 ай бұрын
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'; } });
@estheror3027
@estheror3027 2 жыл бұрын
hey sir, great video! after closing the video, it doesn't pause. can you type the pause command here? thanks!!!
@MrWebDesignerAnas
@MrWebDesignerAnas 2 жыл бұрын
closeVideo.onclick = () =>{ mainVideo.pause(); }
@together-goodstuffhappens8205
@together-goodstuffhappens8205 2 жыл бұрын
@@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.🙂
@None-code-02
@None-code-02 Жыл бұрын
@@MrWebDesignerAnas where should I place this code sir
@concretefist5672
@concretefist5672 7 ай бұрын
bro why you dont copy the full code somewhere you dont explain what you are doing anyway
@bimaltwayana2058
@bimaltwayana2058 2 жыл бұрын
where is the audio for description?
@manhtganf
@manhtganf Жыл бұрын
how to upload wizard ??? Please tutorials
@OdhavSoftech
@OdhavSoftech Жыл бұрын
js is not working...plz help
@salvaravens
@salvaravens 2 жыл бұрын
it`s possible to create this popup with s?
@MrWebDesignerAnas
@MrWebDesignerAnas 2 жыл бұрын
yeah sure!
@salvaravens
@salvaravens 2 жыл бұрын
@@MrWebDesignerAnas i've tried replacing the "video" tags with "" but the popup doesn't open when clicking the videos.
@abdellahidalioua9611
@abdellahidalioua9611 2 жыл бұрын
Source code please
@programmingwithkartik4319
@programmingwithkartik4319 3 жыл бұрын
Konse theme hai ye vs code me
@MrWebDesignerAnas
@MrWebDesignerAnas 3 жыл бұрын
leatus dark theme
@hafezagina
@hafezagina Жыл бұрын
could you please upload the code to buy a coffee?
@MrWebDesignerAnas
@MrWebDesignerAnas Жыл бұрын
I'll try to make even a better version of this code in the future and provide it for free
@hafezagina
@hafezagina Жыл бұрын
@@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
@salvaravens
@salvaravens 2 жыл бұрын
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.
@MrWebDesignerAnas
@MrWebDesignerAnas 2 жыл бұрын
did you write the exact code shown in the descriptions?
@salvaravens
@salvaravens 2 жыл бұрын
@@MrWebDesignerAnas yes, i even rewrote it a couple of times to make sure it was exactly the same..
@salvaravens
@salvaravens 2 жыл бұрын
Now its working! but when i close the popup video with the X the audio keeps playing without the video.
@MrWebDesignerAnas
@MrWebDesignerAnas 2 жыл бұрын
@@salvaravens use a javascript function called paused() on video selector in javascript!
@salvaravens
@salvaravens 2 жыл бұрын
@@MrWebDesignerAnas after trying several times, it worked!! thanks!!!
@joseW418
@joseW418 Жыл бұрын
Upload here the code Bro🙏😍
@sangarstudio6435
@sangarstudio6435 2 жыл бұрын
Sourse code please
@viane123456
@viane123456 2 жыл бұрын
can you give source/
@mariel7388
@mariel7388 2 жыл бұрын
Pls give code
@syediqbalahmed3176
@syediqbalahmed3176 3 жыл бұрын
vola ... ocay ...
Create A Responsive Video Playlist Gallery Using HTML - CSS - Javascript
12:29
娜美这是在浪费食物 #路飞#海贼王
00:20
路飞与唐舞桐
Рет қаралды 6 МЛН
Get 10 Mega Boxes OR 60 Starr Drops!!
01:39
Brawl Stars
Рет қаралды 19 МЛН
❌Разве такое возможно? #story
01:00
Кэри Найс
Рет қаралды 4 МЛН
Oh No! My Doll Fell In The Dirt🤧💩
00:17
ToolTastic
Рет қаралды 12 МЛН
These CSS PRO Tips & Tricks Will Blow Your Mind!
8:48
Coding2GO
Рет қаралды 260 М.
Award Winning Animation With Only 20 Lines Of CSS?
6:59
Hyperplexed
Рет қаралды 1,7 МЛН
Responsive Video Popup on Click using CSS3 & Vanilla Javascript
6:36
Online Tutorials
Рет қаралды 53 М.
How To Make A Responsive Video Playlist Using HTML CSS & JavaScript
19:11
The Easiest Way to Build Websites
10:56
Sajid
Рет қаралды 447 М.
CSS Tips And Tricks I Wish I Knew Before
12:12
Lama Dev
Рет қаралды 470 М.
You Don't Need JavaScript For This - CSS ONLY Infinite Scroll
23:35
Slaying The Dragon
Рет қаралды 100 М.
Top 10 CSS One Liners That Will Blow Your Mind
13:34
developedbyed
Рет қаралды 945 М.
娜美这是在浪费食物 #路飞#海贼王
00:20
路飞与唐舞桐
Рет қаралды 6 МЛН