Модальные окна jQuery.
Здравствуйте, есть скрипт:
jQuery(function ($) { var OSX = { container: null, init: function () { $("input.osx, a.osx").click(function (e) { e.preventDefault(); $("#osx-modal-content").modal({ overlayId: 'osx-overlay', containerId: 'osx-container', closeHTML: null, minHeight: 80, opacity: 65, position: ['0',], overlayClose: true, onOpen: OSX.open, onClose: OSX.close }); }); }, open: function (d) { var self = this; self.container = d.container[0]; d.overlay.fadeIn('slow', function () { $("#osx-modal-content", self.container).show(); var title = $("#osx-modal-title", self.container); title.show(); d.container.slideDown('slow', function () { setTimeout(function () { var h = $("#osx-modal-data", self.container).height() + title.height() + 20; // padding d.container.animate( {height: h}, 200, function () { $("div.close", self.container).show(); $("#osx-modal-data", self.container).show(); } ); }, 300); }); }) }, close: function (d) { var self = this; // this = SimpleModal object d.container.animate( {top:"-" + (d.container.height() + 20)}, 500, function () { self.close(); // or $.modal.close(); } ); } }; OSX.init(); }); Который при помощи jquery.simplemodal.js и jquery.js при нажатии на кнопку с class='osx' выводит окошко,а точнее блок с id "osx-modal-content" и закрывает через кнопку с class="simplemodal-close" Но такой блок может быть всего один, помогите пожалуйста дописать ,что бы в class='osx' можно было ещё дописывать например номер блока который нужно вывести. Буду очень благодарен. |
Вложений: 1
Вот демо скрипта
(Прикреплён архив) |
Вложений: 1
Смог сделать сам.
Уверен что можно было сделать намного легче ,но ладно. Если кому нужно вот архив: |
Часовой пояс GMT +3, время: 16:52. |