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

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 พ.ย. 2024

ความคิดเห็น • 106

  • @vikrambais4885
    @vikrambais4885 ปีที่แล้ว

    one like for splendid work.. because of this i got alot of help in my project...

  • @gamermafiabeast786
    @gamermafiabeast786 4 หลายเดือนก่อน

    Thankyou very very much, I was stuck in this for days. ❤❤❤

  • @ozodbekboriboyev1010
    @ozodbekboriboyev1010 2 ปีที่แล้ว +2

    Thank you a lot. You helped to solve my problem! God bless you 🙏

  • @DaudiNungwana
    @DaudiNungwana ปีที่แล้ว +8

    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
    }

  • @aichan8730
    @aichan8730 ปีที่แล้ว

    much loooove ❤❤❤❤

  • @jnd6807
    @jnd6807 2 ปีที่แล้ว

    Wonderful so educational

  • @exodusmediasg
    @exodusmediasg 3 ปีที่แล้ว +1

    Thank you for porviding this tutorial and many others on your channel. Appreciated

  • @naugustus939
    @naugustus939 ปีที่แล้ว +1

    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?

  • @fajarsaputra4si502
    @fajarsaputra4si502 2 ปีที่แล้ว

    Thanks For Tutor Sir

  • @karnatakashushma4788
    @karnatakashushma4788 3 ปีที่แล้ว +1

    Your videos are really awesome 🔥.

  • @suhailnexgeno
    @suhailnexgeno ปีที่แล้ว

    Thank you my bro

  • @bekisahmet2326
    @bekisahmet2326 9 หลายเดือนก่อน

    thank you so much

  • @trunglekien8217
    @trunglekien8217 3 ปีที่แล้ว

    you're really fanstatic

  • @ritikasaini629
    @ritikasaini629 3 ปีที่แล้ว

    Great😎

  • @sumondatta3440
    @sumondatta3440 2 ปีที่แล้ว

    boss you are great❤

  • @thinguyeninh2028
    @thinguyeninh2028 3 ปีที่แล้ว

    so cool bro, tks

  • @renkselalbumtasarm3597
    @renkselalbumtasarm3597 2 ปีที่แล้ว +9

    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 ปีที่แล้ว +1

      agree @Mr. Web Designer

  • @jackotex6205
    @jackotex6205 ปีที่แล้ว +2

    Nice Video! How can I pause the music after closing the video when working with ? I embedded a video from TH-cam

    • @furkanesen8429
      @furkanesen8429 ปีที่แล้ว

      Yes. I cant. How can I pause the music ??

    • @yusufsabr2288
      @yusufsabr2288 ปีที่แล้ว

      @@furkanesen8429 hocam çözdün mü ya kafayı yedim çözemedim

  • @Axel-Ehh
    @Axel-Ehh 5 หลายเดือนก่อน

    can you put like text or descriptions on each class or of what you are doing

  • @FidelEmilioSusanaJimenez
    @FidelEmilioSusanaJimenez ปีที่แล้ว

    👽😍😍

  • @edbertcadavero14
    @edbertcadavero14 ปีที่แล้ว +2

    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????

  • @ZUOSLP
    @ZUOSLP 2 ปีที่แล้ว +1

    Really cool video. I have a question: Can we use this method work with youtube videos?

  • @MrAkalp
    @MrAkalp 8 หลายเดือนก่อน

    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

  • @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?

  • @ideiasderendaextraoficial
    @ideiasderendaextraoficial 2 ปีที่แล้ว

    ty

  • @sangarstudio6435
    @sangarstudio6435 2 ปีที่แล้ว

    I don't know how to thank you 😍

  • @aniketashokbhise
    @aniketashokbhise 3 ปีที่แล้ว

    😍😍😍

  • @DreysyPG
    @DreysyPG 2 ปีที่แล้ว +1

    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

  • @gousiyaart2515
    @gousiyaart2515 3 ปีที่แล้ว

    Assalamualaikum
    Brothers e-commerce product image description hiden
    Main image on click after open description
    Please reply

  • @snaqvi009
    @snaqvi009 2 ปีที่แล้ว +2

    HI, Great tutorials.
    How to add titles and tags with same responsive design ?
    Thanks

    • @MrWebDesignerAnas
      @MrWebDesignerAnas  2 ปีที่แล้ว +1

      might this help you : th-cam.com/video/YZLuBdYgDsA/w-d-xo.html

  • @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

  • @sabrinasung1618
    @sabrinasung1618 3 ปีที่แล้ว +2

    hi my video is working fine but after closing the video the sound is still playing how to fix this?

    • @MrWebDesignerAnas
      @MrWebDesignerAnas  3 ปีที่แล้ว

      are you using opacity:0 or display:none property to hide video?

    • @Jesusworshipsongs-robbie
      @Jesusworshipsongs-robbie 3 ปีที่แล้ว

      @@MrWebDesignerAnas Thanks for an excellent video. Using display: none in javascript

    • @justein2334
      @justein2334 3 ปีที่แล้ว

      @@MrWebDesignerAnas same issue, I did exactly what you did

  • @invisibletechnician8732
    @invisibletechnician8732 2 ปีที่แล้ว

    How to upload new post this site.

    • @MrWebDesignerAnas
      @MrWebDesignerAnas  2 ปีที่แล้ว

      this is the advance version of this video but you can upload it from here :
      th-cam.com/video/wvu37Ze0HmE/w-d-xo.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?

  • @manhtganf
    @manhtganf 2 ปีที่แล้ว

    how to upload wizard ??? Please tutorials

  • @apnacoding3798
    @apnacoding3798 2 ปีที่แล้ว

    काय विडीयो बनवलेत हो खूपच छान 🙏
    Sir all video name kye ahet ho sangal kye mala

    • @MrWebDesignerAnas
      @MrWebDesignerAnas  2 ปีที่แล้ว +1

      ????

    • @apnacoding3798
      @apnacoding3798 2 ปีที่แล้ว

      @@MrWebDesignerAnas
      Sir mala tumhi video download kele tyanche name sanga sir

  • @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 ปีที่แล้ว +1

      It's best to use an to do that

  • @benjamindame3879
    @benjamindame3879 2 ปีที่แล้ว

    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

  • @BuffaloBlack
    @BuffaloBlack ปีที่แล้ว +1

    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.

  • @together-goodstuffhappens8205
    @together-goodstuffhappens8205 2 ปีที่แล้ว +3

    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 ปีที่แล้ว +5

      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 ปีที่แล้ว +1

      @@together-goodstuffhappens8205 glad I was of help.

  • @bimaltwayana2058
    @bimaltwayana2058 2 ปีที่แล้ว

    where is the audio for description?

  • @michaeljohnaprahamian4346
    @michaeljohnaprahamian4346 2 ปีที่แล้ว

    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  2 ปีที่แล้ว

      check the javascript code! the classname should be correct

  • @bimaltwayana2058
    @bimaltwayana2058 2 ปีที่แล้ว +1

    please share the code..

  • @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 ปีที่แล้ว +1

      @@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

  • @VicenteCarlosFernandes
    @VicenteCarlosFernandes 10 หลายเดือนก่อน +1

    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';
    }
    });

  • @concretefist5672
    @concretefist5672 10 หลายเดือนก่อน

    bro why you dont copy the full code somewhere you dont explain what you are doing anyway

  • @OdhavSoftech
    @OdhavSoftech ปีที่แล้ว

    js is not working...plz help

  • @abdellahidalioua9611
    @abdellahidalioua9611 2 ปีที่แล้ว +1

    Source code please

  • @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.

  • @sangarstudio6435
    @sangarstudio6435 2 ปีที่แล้ว

    Sourse code please

  • @hafezagina
    @hafezagina ปีที่แล้ว

    could you please upload the code to buy a coffee?

    • @MrWebDesignerAnas
      @MrWebDesignerAnas  ปีที่แล้ว +1

      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!!!

  • @programmingwithkartik4319
    @programmingwithkartik4319 3 ปีที่แล้ว

    Konse theme hai ye vs code me

  • @viane123456
    @viane123456 2 ปีที่แล้ว

    can you give source/

  • @joseW418
    @joseW418 ปีที่แล้ว

    Upload here the code Bro🙏😍

  • @mariel7388
    @mariel7388 3 ปีที่แล้ว

    Pls give code

  • @Ava-23
    @Ava-23 หลายเดือนก่อน

    source code please

    • @MrWebDesignerAnas
      @MrWebDesignerAnas  หลายเดือนก่อน

      in the description if not found there's an another video gallery website with source code

  • @syediqbalahmed3176
    @syediqbalahmed3176 3 ปีที่แล้ว

    vola ... ocay ...