// Modal windows
$(function () {
var popupIdPostfix = "company-info";
var mainModal = new BX.PopupWindow(
popupIdPostfix, // постфикс в id обёртки окна, если на странице несколько окон для каждого нужен свой id
null, //объект - возле какого элемента на странице показаться BX("show_here"), null - в центре страницы.
{
content: BX('company-info-modal-content'), // контент окна
closeIcon: true, // нужна ли иконка закрытия, её положение
overlay: {
backgroundColor: 'black',
opacity: '45'
}
}
);
BX.bindDelegate(
document.body, 'click', {className: 'read_about_company' },
function(e){
if(!e) {
e = window.event;
}
BX.ajax.insertToNode('/modals/company-info.php', BX('company-info-modal-content'));
mainModal.show(); // Показываем модальное окно
return BX.PreventDefault(e);
}
);
BX.bindDelegate(
document.body, 'click', {className: 'close_btn' },
function(e){
if(!e) {
e = window.event;
}
mainModal.close();
return BX.PreventDefault(e);
}
);
});
html:
<div class="company-info-modal" id="company-info-modal-content">
Загрузка...
</div>