[WB] Popup that closes when clicked outside

Startbeitrag von Piet van Zanten am 07.06.2017 15:09


I finally found a very good jQuery plugin, compact (5KB) and very flexible, that can create a popup that can be closed by a click outside, as is common practice, especially on mobile devices.
I tried several plugins, but e.g. jQuery mobile is using css that interferes with my WB layout.
It is called bPopUp and can be found on dinbror.dk/bpopup/.
It can be used with the jQuery version that WB uses, just be sure to add the script into the end of page (either by code or as HTML in the advanced tab of the page description, because jQuery needs to be loaded first.
An example of a js procedure that I made to open the popup:

function Open_Popup(sPopup,xPos,yPos)
speed: 450,
transition: 'slideIn',
easing: 'linear',
position: [xPos,yPos],
modalColor: 'Gray',
positionStyle: ['absolute']
Call it in the browser code of a button or link (don't forget to set action to none) like: Open_Popup(MyPopup..Alias,20,40)
The parameters:
sPopup: the alias of a WB popup
xPos, yPos: the position of the popup (or 'auto' to center)
Make sure to use a cell as a container in the WB popup, as the style of the popup itself will be lost when opening the popup.
The api can be found here: http://dinbror.dk/blog/bpopup/
This would be a great feature to include in Webdev (and imo very easy to implement) but unfortunately it is not.

Have fun!

Kind regards,


Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.