当前位置:   article > 正文

自定义H5页面dialog弹窗_h5 写弹窗怎么写

h5 写弹窗怎么写

弹窗一:

样式如下:


HTML代码:

  1. //弹出窗
  2. <div class="dialog hide">
  3. <p class="title tc">通知</p>
  4. <section class="content"></section>
  5. <div class="dialog-footer">
  6. <button type="button" type="button" class="dialog-btn cancel">取消</button>
  7. <button type="button" type="button" class="dialog-btn sure">确认</button>
  8. </div>
  9. </div>
  10. //遮罩层
  11. <div class="mark hide"></div>
JS代码:
  1. function tipDialog(text){
  2. $('.dialog .content').text(text);
  3. $('.dialog, .mark').removeClass('hide');
  4. }
tipDialog( "1111");
  1. $(".sure").click(function(){
  2. var type= $(this).attr('type');
  3. if(type==='bind'){
  4. var link = '/home/employee/employeeBindCompany';
  5. }else{
  6. var link = '/home/employee/employeeUpdateCompany';
  7. }
  8. $.ajax({
  9. type: 'POST',
  10. url: url + link,
  11. dataType: 'json',
  12. contentType: "application/json",//;charset=utf-8
  13. data: JSON.stringify({
  14. "phone": phone,
  15. "companyId": parseInt(companyId,10)
  16. }),
  17. success: function (res) {
  18. window.location.href="success.html"
  19. }
  20. });
  21. });
  22. $('.cancel').click(function(){
  23. $('.dialog, .mark').addClass('hide');
  24. });



声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/321532
推荐阅读
相关标签
  

闽ICP备14008679号