// ========================================================== // password toggle // ========================================================== ;(function($) { let pwdStep = 0 $(document).on('click', '.password-toggle', function(e) { pwdStep = (pwdStep + 1) % 2 const inputTarget = $(this).parents('.form-group').find('input') passwordCheck($(this), inputTarget, pwdStep) }) let pwdStep2 = 0 $(document).on('click', '.password-toggle-chk', function(e) { pwdStep2 = (pwdStep2 + 1) % 2 const inputTarget = $(this).parents('.form-group').find('input') passwordCheck($(this), inputTarget, pwdStep2) }) })($) function passwordCheck(thisItem, targetItem, step) { if(step) { targetItem.attr('type', 'text') thisItem.addClass('theme-open') } else { targetItem.attr('type', 'password') thisItem.removeClass('theme-open') } } // ========================================================== // 忘記密碼切換 // ========================================================== ;(function($) { $('.form-switch .btn-change').on('click', function(e) { $(this).parents('.form-switch').hide().siblings('.form-switch').show(); if($("#forget-box1").css('display') == 'block'){ $("#Forget_Cellphone").attr('fun', 'checkNull'); $("#Forget_Email").attr('fun', ''); $("#Kind").val('SMS'); } else{ $("#Forget_Cellphone").attr('fun', ''); $("#Forget_Email").attr('fun', 'checkEmailNull'); $("#Kind").val('MAIL'); } }) })($) // ========================================================== // // ========================================================== $(function(){ $('#agree_check').click(function(){ $('#agree').val(''); if($(this).prop("checked")){ $('#agree').val('1'); } }); }); // ========================================================== // js-popup // ========================================================== ;(function($) { $('body').on('click', '.js-popup-button', function(e) { e.preventDefault() const targetUrl = $(this).data('url') const targetPicture = $(this).data('pic') $('body').append( ``) }) $('body').on('click', '.js-popup-window .closer', function(e) { e.preventDefault() $(this).parents('.js-popup-window').remove() }) })($)