index.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. document.title = '海居网-新年专题';
  2. $(function(){
  3. $('.Mbutom a').on('click',function() {
  4. $('body,html').animate({scrollTop:0},500);
  5. return false;
  6. });
  7. var topposrt = $('.ynZTboxhead').offset().top+$('.ynZTboxhead').height();
  8. $(window).scroll(function(){
  9. if($(window).scrollTop()>topposrt){
  10. $(".rightxg").show();
  11. }else{
  12. $(".rightxg").hide();
  13. }
  14. });
  15. if($(window).scrollTop()>topposrt){
  16. $(".rightxg").show();
  17. }else{
  18. $(".rightxg").hide();
  19. }
  20. $('.rightxg_m').smint({
  21. 'scrollSpeed' : 1000
  22. });
  23. $('.applyct').on('click',function(){
  24. var hid=$(this).attr('data-hid');
  25. var source=$(this).attr('data-source');
  26. // var city=$(this).attr('data-city');
  27. $('.tanchung_form input[name="hid"]').val(hid)
  28. $('.tanchung_form input[name="source"]').val(source)
  29. // $('.tanchung_form input[name="intention_city"]').val(city)
  30. group();
  31. })
  32. $('.tanchung_gb').on('click',function(){
  33. delbox()
  34. })
  35. //报名验证提交的调用 底下报名
  36. PublicAction.AjaxSend({CORID:'butt_s'/*操作ID*/});
  37. $('.submit_area .butt_s').on('click',function(){
  38. setTimeout(function(){
  39. var _html = $('.alert-container .alert-content').html();
  40. if(_html == '提交成功'){
  41. delbox();
  42. $('.in_ti').val('');
  43. $('.in_od').val('');
  44. }
  45. console.log(_html);
  46. },300)
  47. })
  48. })
  49. function group(){
  50. iBoxWidth = $(".tanchung").width();
  51. iBoxHeight = $(".tanchung").height();
  52. iWinWidth = $(window).width();
  53. iWinHeight = $(window).height();
  54. $(".tanchung").css("left", (iWinWidth / 2 - iBoxWidth / 2) + "px");
  55. $(".tanchung").css("top", ((iWinHeight / 2 - iBoxHeight / 2)-50) + "px");
  56. $(".tanchung").fadeIn();
  57. $(".tanchung_bg").height(document.body.offsetHeight);
  58. $(".tanchung_bg").show();
  59. }
  60. function delbox(){
  61. $(".tanchung").fadeOut();
  62. $(".tanchung_bg").hide();
  63. }