Modal with HTML, CSS and JavaScript

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 พ.ย. 2019
  • Learn how to create a modal, from scratch, with HTML, CSS and JavaScript.
    A modal is a popup box, usually positioned on top of everything else in the document and it is used to attract the user's attention to some special information or to ask the user to do something (for example to register or login) without navigating to another page.
    It is a commonly used component in websites and that's why I thought it would be a good idea to implement it from scratch as an alternative to using some third-party library or framework for this purpose.
    In the first half of the video, we create the structure (HTML), styling (CSS) and functionality (JavaScript) for a basic modal, which can be triggered upon a button click and dismissed upon a click over the modal close button or the modal backdrop (background overlay). We then proceed to adding an entrance and exit animation to the modal, and finally, we make the necessary modifications in order to take into account the case where more than one modals exist in our page.
    Enjoy 🙂
    Don’t forget to share, like, subscribe and I would love to hear your thoughts in the comments section below!
    Code for this Project: codepen.io/Coding_Journey/pen...
    Modal Examples based on this Project: codepen.io/Coding_Journey/pen...
    Support the Channel 💙☕🙏
    PayPal: paypal.me/CodingJourney
    Suggested Videos:
    Share Selected Text with JavaScript: • Share Selected Text wi...
    HTML Drag and Drop API: • HTML Drag and Drop API
    Marquee-like Content Scrolling (HTML & CSS): • Marquee-like Content S...
    Simple Auto-Playing Image Slideshow (HTML, CSS and JavaScript): • Simple Auto-Playing Im...
    Animations with Animate.css: • Animations with Animat...
    Codepen: codepen.io/Coding_Journey/
    Twitter: / codingjrney
    Email: codingjourney123@gmail.com
    Subscribe 💖
    / @codingjourney

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

  • @shahbokhari
    @shahbokhari 4 ปีที่แล้ว +4

    Dear Sir, you’ve made a very difficult job so easy. Many developers seems to struggle making the reusable modals script. Your efforts are the answer of many many young and new developer’s prayer. We love you. Thank You so much for sharing your knowledge. Take care and Stay Safe. The world needs developers like you.

    • @CodingJourney
      @CodingJourney  4 ปีที่แล้ว

      Oh thank you so much for this amazing comment 🙏 My pleasure 🙂 Indeed, my goal was to create a nice, reusable modal component and I am very glad to hear that this is useful to fellow developers!! Love is mutual 😉 You too, take care, all the best!!

  • @PatrykKarwowski-ww5ij
    @PatrykKarwowski-ww5ij 3 หลายเดือนก่อน

    You are the best teacher of java script on youtube. Topics that are really hard to understand watching other youtube tutors, get really easy after watching your tutorials. If you had any courses on udemy or skillshare I would parchuse them straight away.

    • @CodingJourney
      @CodingJourney  3 หลายเดือนก่อน +1

      Oh thank you so much mate! Comments like yours make me want to come back to creating web dev tutorials 🙂 Wishing you all the best in your web dev journey! Huge love 💙

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

    Best Modal tutorial on TH-cam !!
    Thank You !!

    • @CodingJourney
      @CodingJourney  4 ปีที่แล้ว

      Oh thank you for the lovely comment!! Very glad you think so 😉💙💙

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

    That was as good as it gets 👍👍🙏 Thank you so much man, exactly what I was looking for! Keep up the great work 💖

    • @CodingJourney
      @CodingJourney  4 ปีที่แล้ว

      Thank you for the lovely comment 🙂 Very glad it helped! I will 😉💙

  • @stevenharris7049
    @stevenharris7049 4 ปีที่แล้ว +3

    Huge thanks for this tutorial man! It's amazing how you answer all of my questions before even asking 😊👏 Thank you 🙏

    • @CodingJourney
      @CodingJourney  4 ปีที่แล้ว

      Heheh!! Absolutely delighted to hear that 🙏🙂

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

    Everything is very well explained. Your videos are getting better and better. I learned so many things. Never heard about defer attribute. Well done !

    • @CodingJourney
      @CodingJourney  4 ปีที่แล้ว

      Thanks so much for the lovely feedback Frank! Always trying to improve...not always successful though, but that's life 😄 I hope in the long term, trend will be upward 🙂 Absolutely love your channel, so I'm humbled by your nice words!! Keep up the great work!!!

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

    Brilliant Sir! Thank you!

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

    This is bloody amazing free content. Thank you brother

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

      Oh thanks bro! My pleasure 🙂💙

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

    A really nice tutorial. You give a surprisingly detailed and complete explanation, even on side topics that have nothing to do with a modal. This gives a complete overview. Maybe, I make a vue js version, thanks for the inspiration. Keep it going, Bro. ✌😀

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

      Thanks so much for taking the time to watch and provide feedback Mario! You are awesome 🙂 I'm trying to explain as much as I can, but maybe I should resist that urge sometimes since I end up with a long video...it's a double-edged sword...I don't know, hope I'll find the sweet spot at some point 😄 Vue js modal sounds nice 😉 Looking forward to your next video Mario! Keep it up!!!

    • @Webnoob
      @Webnoob 4 ปีที่แล้ว

      Coding Journey Yeah, I know what you mean. You can try different things and in the end you see in the analytics what is good or not. We are still completely at the beginning of our journey and start from the bottom. 😂

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

      Analytics know nothing, I know better 😂 kidding of course...I suppose this would be a recipe for stagnation 😄 A good thing about being a small channel is the freedom to experiment with less stress 🙂 Keep going bro...and, in the meantime, let's not forget to enjoy the journey!!! 🙂

  • @Tony-pe3kp
    @Tony-pe3kp 3 ปีที่แล้ว +1

    💯🔥 Excellent tutorial thank you!!!!

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

      Amazing!! Glad you enjoyed it 🙂

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

    Thank you very much ! I like your videos which teaching style is step by step. Keep coding ❤

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

      My pleasure, thanks for the support!! You too 😉💙💙

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

    Many thanks for the tutorial, keep up the good work

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

    greate jobs, thank you sir. (from indonesia)

    • @CodingJourney
      @CodingJourney  4 ปีที่แล้ว

      Very nice! Glad you liked it 🙂 Greetings to Indonesia!!

  • @ZachHamrick-do4ri
    @ZachHamrick-do4ri หลายเดือนก่อน

    Amazing content. !!!
    Quick questions ! If I were using html blocks to construct this in elementor, is it possible to split these into four html blocks, all held inside the same page. One block as the main block containing the trigger buttons, and the rest of the three blocks will contain the modals themselves. would this work? im having issues with too much code in one block and my page stability is suffering.
    Would this code have to change at all if I were to proceed as I described above.

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

    Can you make a tutorial how to build modal form edit data like this tutorial ? Without use modal botstrap

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

    Hello how to code Close modal when I click ESC ?

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

      Hey! I think what you are looking for starts at 37:20 🙂 All the best, keep coding!! 😉🍻

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

      @@CodingJourney wow thanks 😍