This version is old school.
Please find jQuery plugins on npm.
A very light weight(2.5kb minified) modal window plugin which suits your basic needs.
modalBox.js is a very light weight modal window plugin packed with only most used features and options. Its overall size is around 5.3 kb ( 2.5 kb minified). Core of plugin is completly explained in homepage, so you can easily extend it according to your need.