the-modal
the-modal copied to clipboard
$.get is not opening content in specified #id modal div
$('#modal-window').modal({
lockClass: 'modal-lock',
overlayClass: 'modal-overlay',
closeOnEsc: false,
closeOnOverlayClick: false,
onBeforeClose: null,
onClose: null,
onOpen: function(el, options){
$.get('http://'+siteroot+modalPath+modalContent+'.php', function(data){
el.html(data);
});
},
cloning: true
}).open();
I'm using this. But when it openes the php file it just dumps the content in "modal-overlay" div. Am i missing something here?
check the content that returns by your url. it should be partial html, without
etc.
На самом деле, проблема имеет место быть. Сам наступил на эти грабли. Скорей всего дело в несоответствующей документации, которая вводит в заблуждение.
Берем пример из документации
$.modal().open({
onOpen: function(el, options){
el.html('Hello!');
}
});
ожидаем, что откроется модал с надписью Hello. Написано же "You can use it w/o markup at all by opening empty modal and filling it with custom data the way you want (see below)." Но фигвам! Затеняется оверлей и на его фоне пишется "Hello". Получается, "w/o markup" уже не работает?
В первоначальной версии в onOpen передавался элемент диалога, а потом стали передавать элемент оверлея.
Хм... с какого коммита?
наверное это https://github.com/samdark/the-modal/commit/434530e26d187581493a7466df0e1f21a12dc4df /* как правильно вставлять ссылку на коммит? */
Да, похоже. Доку надо поправить, но времени сейчас в обрез :( Если сделаете pull request — с удовольствием смёржу.