From ea93e6884bdaf8f46f13a76bfdd763abfc0ac0cc Mon Sep 17 00:00:00 2001 From: filesite Date: Tue, 19 Sep 2023 16:58:41 +0800 Subject: [PATCH] fix modal show --- www/js/tajian.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/www/js/tajian.js b/www/js/tajian.js index a3d4512..dadd008 100644 --- a/www/js/tajian.js +++ b/www/js/tajian.js @@ -1,6 +1,25 @@ /* for theme TaJian */ (function() { + //show modal + $('.btn-open').click(function(evt) { + var target_id = $(evt.target).parents('.btn-open').attr('href'); + if ($(evt.target).hasClass('btn-open')) { + target_id = $(evt.target).attr('href'); + } + $(target_id).css('display', 'block'); + }); + + //hide modal + $('.btn-close').click(function(evt) { + $(evt.target).parents('.modal-mask').css('display', 'none'); + }); + $('.modal-mask').click(function(evt) { + if ($(evt.target).hasClass('modal-mask')) { + $(evt.target).css('display', 'none'); + } + }); + $('#btn_addfav').click(function(e) { var share_content = $('input[name=share_content]').val(), select_tag = $('select[name=tag]').val();