Adicioando um "document_modal" em lightbox para suas janelas popup!
Código:
Espero que gostem,
JS
Código:
- Código:
/*#PLUGIN# =====================================================================================================================
Name ..........: show_popup( )
Description ...: Mostra uma popup com efeito lightbox!
Syntax ........: show_popup( element, focus )
Parameters ....: element - Uma classe ou id que deseja abrir em popup.
focus - Elemento que deseja dar foco, pode ser uma classe ou id.
Return values .: Success - A janela popup em lightbox.
Failure - Retorna falso.
Author ........: João Carlos (JScript FROM Brazil)
Modified ......:
Remarks .......:
Related .......:
Link ..........:
Example .......: show_popup('ban_member_popup', '#input_ban');
===============================================================================================================================*/
function show_popup( element, focus ) {
if ( element == '' ) {return false;}
var $oObj = $('#' + element);
var oldIndex = 0;
/* Add an "document_modal" to the code...*/
$oObj.before('<div id="popup_modal" class="modal" style="display:none; width: 100%; height: 100%; position: fixed; top: 0px; left: 0px; z-index: 10000; opacity: 0.4; background-color: #3E3E3E;"></div>');
/* Save original z-index order and sets new...*/
oldIndex = $oObj.css('z-index');
$oObj.css('z-index', '10001');
if ($oObj.css('display') == 'none') {
$oObj.add('#popup_modal').fadeIn('slow');
if ( focus != '' ) {$(focus).focus();}
} else {
$oObj.add('#popup_modal').fadeOut('slow');
/* restore original z-index */
$oObj.css('z-index', oldIndex);
/* Remove "document_modal"! */
$oObj.parent().remove('#popup_modal');
}
}
Espero que gostem,
JS