jQuery Dialog Plug in ArtDialog Close When Double clicking Mask Layer

  • 2021-07-09 06:44:50
  • OfStack

This article illustrates how the jQuery dialog plug-in ArtDialog closes when the mask layer is double-clicked. Share it for your reference, as follows:

As we all know, ArtDialog is a very good, lightweight, dialog plug-in based on jQuery, which is highly sought after by everyone. Everyone can download it at the address below 1:

https://code.google.com/p/artdialog/
https://github.com/aui/artDialog

As of September 17, 2014, there have been several major versions of v 4.1. 7, v 5.0. 4 and v 6.0. 2, of which version 4. x supports iframe, and later versions have removed this 1 function. See the previous download address description for details.

But in this plug-in, if we double-click the mask layer, the dialog box will automatically close at this time, so how to solve this problem? Please see the following instructions (here I take v version 4.1. 7 as an example):

1. Open the file artDialog. source. js, roughly at line 1404 (or look for the keyword "dblclick"):


lockMask.bind('click', function () {
that._reset();
}).bind('dblclick', function () {
  that._click(that.config.cancelVal);
});

2. Modify the above code as follows:


lockMask.bind('click', function () {
that._reset();
}).bind('dblclick', function () {
  // Primitive 
  //that._click(that.config.cancelVal);
  //quber Mask double-clicking on the mask to close the dialog box 
  if (config.dblclick_hide) {
    that._click('cancel');
  }
});

For more readers interested in jQuery related content, please check the topics of this site: "Summary of jQuery Extension Skills", "Summary of jQuery Common Plug-ins and Usage", "Summary of jQuery Drag Effects and Skills", "Summary of jQuery Table (table) Operation Skills", "Summary of Ajax Usage in jquery", "Summary of jQuery Common Classic Special Effects", "Summary of jQuery Animation and Special Effects Usage" and "Summary of jquery Selector Usage"

I hope this article is helpful to everyone's jQuery programming.


Related articles: