signup.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. * 手机端报名弹窗JS
  3. * 调用的时候,只在需要的地方添加上 popup 类就可以了
  4. */
  5. $(function(){
  6. var w_title,w_id,w_text,w_module; //为了这些变量在其它地方用;
  7. /*
  8. * 其它公共报名弹窗
  9. * */
  10. $('.appleBm_popup').on('click',function(){
  11. var $that = $(this);
  12. CreatePopLayerDiv(300,400,'/public/signup');
  13. $('.m_signUp_box').show();
  14. // 向弹窗传数据
  15. parent.w_title = $that.attr('data-title'); //把楼盘名称传向父级
  16. parent.w_id = $that.attr('data-id'); //把楼盘ID传向父级
  17. parent.w_module = $that.attr('data-module'); //模块ID
  18. parent.w_text = $that.attr('data-text'); //窗口文本内容
  19. })
  20. /*
  21. * 新公共报名弹窗 小明
  22. * */
  23. $('.m_appleBm_popup').on('click',function(){
  24. var $that = $(this);
  25. CreatePopLayerDiv(300,400,'/public/signupv2');
  26. $('.m_signUp_box').show();
  27. // 向弹窗传数据
  28. parent.w_title = $that.attr('data-title'); //把楼盘名称传向父级
  29. parent.w_id = $that.attr('data-id'); //把楼盘ID传向父级
  30. parent.w_module = $that.attr('data-module'); //模块ID
  31. parent.w_text = $that.attr('data-text'); //窗口文本内容
  32. parent.w_button = $that.attr('data-button');
  33. })
  34. /*
  35. * 新公共报名弹窗 小明
  36. * */
  37. $('.xm_appleBm_popup').on('click',function(){
  38. var $that = $(this);
  39. CreatePopLayerDiv(300,400,'/public/signupv3');
  40. $('.m_signUp_box').show();
  41. // 向弹窗传数据
  42. parent.w_title = $that.attr('data-title'); //把楼盘名称传向父级
  43. parent.w_id = $that.attr('data-id'); //把楼盘ID传向父级
  44. parent.w_module = $that.attr('data-module'); //模块ID
  45. parent.w_text = $that.attr('data-text'); //窗口文本内容
  46. })
  47. /*
  48. * 底部看房定制弹窗
  49. * */
  50. $('.customize_btn').on('click',function(){
  51. var $that = $(this);
  52. var height = $('.m_form').outerHeight();
  53. var width = $('.m_form').outerWidth();
  54. CreatePopLayerDiv(width,width,'/public/customization');
  55. $('.m_signUp_box').show();
  56. $('.m_form').css('margin-top',-height/2 -20);
  57. // 向弹窗传数据
  58. parent.w_title = $that.attr('data-name'); //把楼盘名称传向父级
  59. parent.w_id = $that.attr('data-id'); //把楼盘ID传向父级
  60. parent.w_module = $that.attr('data-module'); //模块ID
  61. })
  62. })
  63. //创建一个弹出层,width 宽度,height 高度,url
  64. function CreatePopLayerDiv(width,height,url){
  65. var Iheight=$(window).outerHeight();
  66. var Iwidth =$(window).outerWidth();
  67. var heights = height || 300;
  68. var widths = width || 500;
  69. var Oheight= (Iheight -heights) / 2;
  70. var Owidth = (Iwidth - widths) /2;
  71. var div ='<div id="InDiv" style="width:'+Iwidth+'px;height:'+Iheight+'px;background:rgba(0,0,0,0.6);position:fixed;z-index:10000;top:0;left:0;">';
  72. div+='<div id="Content"></div>';
  73. div+='</div>';
  74. $(document.body).append(div);
  75. if(url != ""){
  76. $("#Content").load(url);
  77. }
  78. }
  79. //移除弹出层
  80. function RemoveDiv(){
  81. $("#InDiv").remove();
  82. }