The easiest modeless dialog with jQuery?

Here is a demo:

http://jqueryui.com/demos/dialog/

But this is too cumbersome for me.

A total of 2 thousand lines are included.

I would like to have one in one file with less than 1 thousand lines.

+3
source share
5 answers

If you have an aversion to the complexity caused by a high number of lines, you need to overcome this, or you will end up voodoo , redefining from scratch due to lack of trust and the choice of less complex, but ultimately inferior libraries.

, , , , . , .

:)

+10

JQueryUI , , , http://jqueryui.com/download.

, 1000 , .

+4

@Shore: ,

HTML:

<a id="clickme">Open Dialog</a>

<div id="dialog" style="display:none;">Hello this is a dialog</div>

JS:

$(document).ready(function(){
    // Default settings for dialog
    $("#dialog").dialog({
        bgiframe: true,
        height: 300,
        width: 350,
        autoOpen: false,
        modal: true,
        overlay: { 
            opacity: 0.7,
            background: "black"
        }
    });
   $('#clickme').click(function(){
      $("#dialog").dialog('open');
   }); 
});
0

jqmodal. ( !)
3k.

jqmodal

Init

$('#dialog').jqm(); 


$('#dialog').jqmShow();
0

I asked myself the same question. Where can I find a lightweight plugin labeled without including jQuery UI? After I spent an hour searching the Internet, I decided to implement it myself.

So, after three years the answer:
You can try jquery.mloverlay a simple, easy jQuery plugin to show less modal overlays.

0
source

Source: https://habr.com/ru/post/1715381/


All Articles