JavaScript Modal Popup: Create a modal using HTML, CSS and JavaScript

  Рет қаралды 45,216

Code With Bubb

Code With Bubb

Күн бұрын

Пікірлер: 45
@codewithbubb
@codewithbubb 5 жыл бұрын
You can see how the simple template that is the base to this project was made here: kzbin.info/www/bejne/sIHIZoVopt-Shc0
@theJYC
@theJYC 3 жыл бұрын
This was the most concise tutorial on modals I could find on KZbin. Thank you for the great info.!
@codewithbubb
@codewithbubb 3 жыл бұрын
Cheers! I try to cut out the waffle and get to the point.
@keronwilliams5392
@keronwilliams5392 3 жыл бұрын
Dude you're the GOAT. Thank you!!!
@codewithbubb
@codewithbubb 3 жыл бұрын
Cheers!
@maxim_mahadeva
@maxim_mahadeva 4 жыл бұрын
God Bless You! And may the Force be with you!
@excxmoody
@excxmoody 4 жыл бұрын
You all explaining all of this versus reading at the library...so helpful
@codewithbubb
@codewithbubb 4 жыл бұрын
Glad you are finding it useful Edd 😀
@easy_ev
@easy_ev 5 жыл бұрын
Very good James, keep them coming and I will keep watching and learning.
@codewithbubb
@codewithbubb 5 жыл бұрын
Thanks Chris! Sure, will do. Where are you in your web development journey?
@easy_ev
@easy_ev 5 жыл бұрын
@@codewithbubb I'm quite far in, I think I know a lot about javascript but it's putting it all together, everything you did in the video I knew but applying is something I need to practice more.
@codewithbubb
@codewithbubb 5 жыл бұрын
Yeah, I hear you - just keep practising and it'll get easier over time :)
@makokageyama2190
@makokageyama2190 3 жыл бұрын
Hi! How do you create a modal whenever it is hovered in an area from an image map? I hope you can help me :( thank you so much
@eching975
@eching975 3 жыл бұрын
hi, great video thanks for this. how to make modal box appear only on homepage load?
@PrimephotoStudio
@PrimephotoStudio 4 жыл бұрын
Video is very helpful, thank you for sharing it.
@codewithbubb
@codewithbubb 3 жыл бұрын
You're welcome! Glad you found it useful 😀
@stefanpfadt4353
@stefanpfadt4353 2 жыл бұрын
WOW! can i make the popup only appear when a specific user clicks on it, e.g. guest?
@codewithbubb
@codewithbubb 2 жыл бұрын
Hi Stefan, sure if you have some way of knowing whether a user is a guest or not (you can store it in a cookie / local storage) then you could trigger the modal when that condition is true.
@MuhammadAli-dm8xy
@MuhammadAli-dm8xy 4 жыл бұрын
Hy I want to show without clicking "Show Popup" Botton how I can do that? Please must reply!!
@codewithbubb
@codewithbubb 4 жыл бұрын
You mean call the modal at the end of some sort of event / automatically? Just call the code that's inside the event listener for the click event whenever you want the modal to trigger. Hope that helps?
@elemeno545
@elemeno545 3 жыл бұрын
bruh i keep trying this but i always get the error "uncaught TypeError: document.querySelector(...) is null". and i keep getting this error with every tutorial I use on modal popups!! pls help
@shazbaz5695
@shazbaz5695 4 жыл бұрын
Hi can you please tell me how I can reuse this modal across different pages e.g. all the login buttons on different pages?
@codewithbubb
@codewithbubb 4 жыл бұрын
Hi Shaz, sure you could just add event listeners to any button you want to trigger it on. With this example if you wanted to customise the modal for different buttons you would need to create separate modals for each button (that is different).
@shazbaz5695
@shazbaz5695 4 жыл бұрын
Hi@@codewithbubb I've tried everything. The buttons only get triggered if they are on the same page as the modal and if the buttons are on a different page to the modal it doesn't work. Please take a look at my code below and see if I'm doing something wrong. Thanks: var userSelection = document.getElementsByClassName('button'); var modal = document.getElementById('modal-wrapper'); for (var i = 0; i < userSelection.length; i++) { userSelection[i].addEventListener("click", function() { modal.style.display = 'block'; }); }
@melissamoloney6312
@melissamoloney6312 4 жыл бұрын
this was so helpful! Thank you :)
@Hunterdrom
@Hunterdrom 3 жыл бұрын
Video is great but does anyone know how to link the JS and the HTML, I tried a normal way to link the pages but I guess it needs a function and I do not know enough to figure out how to modify it
@Forbiddendream7
@Forbiddendream7 4 жыл бұрын
unfortunately your examples are broken at link Completed project
@codewithbubb
@codewithbubb 4 жыл бұрын
Thanks for that! I've just taken a look and updated it.
@jonathanchiclla3221
@jonathanchiclla3221 4 жыл бұрын
bien pero lo que se quiere es que la ventana aparesca ni bien abres la pagina web.. sin apretar ningun enlace..porfvr
@KoOodak
@KoOodak 3 жыл бұрын
So great and easy you make it man. What is the name of this program? Thanks for the video 👊
@grandpaK420
@grandpaK420 3 жыл бұрын
Codepen
@johnbenjaminmercado7320
@johnbenjaminmercado7320 4 жыл бұрын
Are you using Sass on this video? I hope i got some reply :(
@codewithbubb
@codewithbubb 4 жыл бұрын
Hi John, yes that's right i'm running parcel as a build tool which automatically compiles Sass in the project. I'm not using many features of Sass here, just the nesting really.
@johnbenjaminmercado7320
@johnbenjaminmercado7320 4 жыл бұрын
Thanks im kinda struggling on the classlist.toggle Because i cant over ride the property For example modal{ Position:absolute; Left: -500px; &--move{ Left: 0px; } When i tried to toggle the class via javascript, and it cant override the property and i dont want to use !important, It doesnt work Is there a thing i dont get here? I hope you could help me out
@codewithbubb
@codewithbubb 4 жыл бұрын
Are you doing this in Codepen? Can you share your code?
@johnbenjaminmercado7320
@johnbenjaminmercado7320 4 жыл бұрын
@@codewithbubb Okay i think I've notice the problem, I've just forgot to put the function inside the event listener, Sometimes you really need a 15 to an hour break just to notice the problem. Thanks for the replies though it really helps a lot ^_^ I hope we can see more content such as this or sample projects with Basic HTML,CSS and javascript.
@codewithbubb
@codewithbubb 4 жыл бұрын
@@johnbenjaminmercado7320 Ah, glad you got it figured out. Yes, sometimes a break can do wonders! Sure, I was planning on doing a series of converting PSD website designs to HTML/CSS if that would be of interest to you?
@DevOpsConnect
@DevOpsConnect 5 жыл бұрын
Can you prepare a video series on angular 6or7
@codewithbubb
@codewithbubb 5 жыл бұрын
Hi Ankit, thanks for the suggestion! I actually use Angular 6/7 quite a lot in my day job. Trouble is, there is a new version release every 6 months so video tutorials become outdated very quickly! I did think about doing some live training on it though - would you be interested if I were to schedule a KZbin live series on Angular?
@krystal9819
@krystal9819 5 жыл бұрын
anyone knows what the name of the text editor that he"s using ?
@codewithbubb
@codewithbubb 5 жыл бұрын
Hi, it's Codepen - codepen.io/
@krystal9819
@krystal9819 5 жыл бұрын
appriciate it bro (y)
@codewithbubb
@codewithbubb 5 жыл бұрын
You're welcome 😀
Learn CSS Animation In 15 Minutes
15:33
Web Dev Simplified
Рет қаралды 771 М.
JavaScript Basics in 10 Minutes
11:49
Topknot Clare
Рет қаралды 225 М.
버블티로 부자 구별하는법4
00:11
진영민yeongmin
Рет қаралды 25 МЛН
REAL 3D brush can draw grass Life Hack #shorts #lifehacks
00:42
MrMaximus
Рет қаралды 12 МЛН
Mom had to stand up for the whole family!❤️😍😁
00:39
Wait for the last one 🤣🤣 #shorts #minecraft
00:28
Cosmo Guy
Рет қаралды 12 МЛН
dialog = the easiest way to make a popup modal
9:40
Kevin Powell
Рет қаралды 194 М.
These CSS PRO Tips & Tricks Will Blow Your Mind!
8:48
Coding2GO
Рет қаралды 427 М.
This is the PRO way to code a JavaScript Modal
31:03
Code With Bubb
Рет қаралды 3,3 М.
How is this Website so fast!?
13:39
Wes Bos
Рет қаралды 560 М.
Top 10 CSS One Liners That Will Blow Your Mind
13:34
developedbyed
Рет қаралды 972 М.
Why Signals Are Better Than React Hooks
16:30
Web Dev Simplified
Рет қаралды 482 М.
How I'd Learn Full-Stack Web Development (If I Could Start Over)
10:28
How To Create A Modal In Javascript and CSS
15:06
developedbyed
Рет қаралды 92 М.
How to create a CSS navigation bar in 6 minutes! 🧭
6:28
Bro Code
Рет қаралды 334 М.
버블티로 부자 구별하는법4
00:11
진영민yeongmin
Рет қаралды 25 МЛН