Premium Only Content
Let's Build A Javascript Modal Plugin From Scratch
Welcome to the first of my Javascript Workouts. The aim with this series is to build as many practical Javascript elements as possible - no frameworks, no plugins. Just plain JS.
In this first video, we'll build ourselves a vanilla Javascript modal plugin. We'll setup default configuration options but allow the user to override them. We'll handle the ability to switch between modals, and lastly, we'll emit four custom events: before opening modal, after opening modal, before closing modal, and after closing modal.
My website
https://www.pixelrocket.store
Project Files
https://www.dropbox.com/s/fcymlamp7rkngqq/modal-plugin.zip?dl=0
Custom Events
https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
Timestamps
0:00 Intro
0:56 Setup starting files
2:10 Difference between procedural JS and OOP JS
3:25 Setup our modal class
4:30 Constructor function
6:00 Setup default options
11:00 Setup init function
13:28 Setup modal triggers
15:50 Binding inside OOP
21:48 Handle modal open
25:06 Setup modal closers
27:28 Handle modal close
31:08 Setup modal CSS classes
39:10 Handle switching between modals
40:31 Handle custom event dispatching
-
9:46
MattMorseTV
10 hours ago $7.75 earnedTrump just SHUT DOWN a $287,000,000 FRAUD RING.
6.59K54 -
15:48
GritsGG
12 hours agoWinning a Rare Solos Prison End Game on Warzone!
59 -
11:37
The Pascal Show
12 hours agoTHEY WANT TO END HER?! Candace Owens Claims French President & First Lady Put A H*t Out On Her?!
1.57K1 -
LIVE
Lofi Girl
2 years agoSynthwave Radio 🌌 - beats to chill/game to
251 watching -
24:30
DeVory Darkins
13 hours agoMarjorie Taylor Greene RESIGNS as Minnesota dealt MAJOR BLOW after fraud scheme exposed
66.5K111 -
2:19:48
Badlands Media
1 day agoDevolution Power Hour Ep. 409: Panic in the Narrative — Epstein, Israel, and the Manufactured Meltdowns
152K40 -
1:52:38
Man in America
10 hours agoCommunists VS Zionists & the Collapse of the American Empire w/ Michael Yon
65.3K25 -
4:09:34
Akademiks
5 hours agoSheck Wes exposes Fake Industry. Future Not supportin his mans? D4VD had help w disposing his ex?
39.6K3 -
6:43:43
SpartakusLIVE
9 hours agoTeam BUNGULATORS || From HUGE WZ DUBS to TOXIC ARC BETRAYALS
108K3 -
2:44:56
BlackDiamondGunsandGear
5 hours agoAre You that guy? / Carrying a Pocket Pistol /After Hours Armory
25.6K