dialog

/** * 模态框 */ $(document).on('click', '[data-modal]', function(e) { e.preventDefault(); $('body').on('touchmove.modal', function(e) { e.preventDefault(); }, false); window.scrollTo(0, 0); var oModal = document.getElementById($(this).data('modal')); $(oModal).addClass('open').on('click', function(e) { if (this === e.target) { e.preventDefault(); $(oModal).removeClass('open'); $('body').off('touchmove.modal'); } }); });
show or hide dialog

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.