Easiest way to use a div as a modal dialog with jQuery
问题 I want to show the contents of a div as a modal dialog using jQuery. Is there any way to do it without using Bootstrap or anything else...? I want to personalize my modal dialog, my own way, via CSS. Please show me a way... 回答1: To "roll-your-own" modal dialog, all you need are two divs: The overlay - sits on top of your page content (we use z-index to accomplish this) The dialog - sits on top of the overlay div Here is a basic code example. $('#mybutt').click(function(){ $('#myOverlay').show