followup.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. // 屏幕试图的高度
  2. let screenHeight = $(window).height()
  3. // 智能随访
  4. let collaborationTeamHight = $('#collaborationTeam').offset().top
  5. $(window).scroll(function () {
  6. // 当前滚动的高度
  7. let currentTop = $(window).scrollTop()
  8. if(currentTop < 2) {
  9. $('#all').removeClass('hanAll')
  10. $('#abc').addClass('abc')
  11. $('#navigationBar').removeClass('white')
  12. $("#loGo").attr("src", './image/logo.png')
  13. } else {
  14. $("#all").addClass("hanAll");
  15. $("#abc").removeClass("abc");
  16. $("#navigationBar").addClass("white");
  17. $("#loGo").attr("src", './image/logo.jpg')
  18. }
  19. // 智能随访滚动计算
  20. if(currentTop > collaborationTeamHight && currentTop < (collaborationTeamHight + screenHeight)) {
  21. let teamOffset = (currentTop - collaborationTeamHight) / screenHeight
  22. console.log(teamOffset, '透明度')
  23. $('#collCentImg').css({'transform': `translate(0, ${(1 - teamOffset) * 250}px)`})
  24. $('#collCentFonts').css({'opacity': teamOffset})
  25. }
  26. })
  27. // 导航下划线
  28. $('.aus li').hover(function () {
  29. let i = $(this).index()
  30. $(".aus li").eq(i).addClass('tils')
  31. },function () {
  32. let i = $(this).index()
  33. $(".aus li").eq(i).removeClass('tils')
  34. })
  35. $('.auss li').hover(function () {
  36. let i = $(this).index()
  37. $(".auss li").eq(i).addClass('tils')
  38. },function () {
  39. let i = $(this).index()
  40. $(".auss li").eq(i).removeClass('tils')
  41. })
  42. // 客服hover
  43. $('#zhixun').hover(function () {
  44. $("#zhixun").show()
  45. $("#consultigImg").attr("src", './image/ions/kefu1.png')
  46. },function () {
  47. $("#zhixun").hide()
  48. $("#consultigImg").attr("src", './image/ions/kefu2.png')
  49. })
  50. $('#consulting').hover(function () {
  51. $("#zhixun").show()
  52. $("#consultigImg").attr("src", './image/ions/kefu1.png')
  53. },function () {
  54. $("#zhixun").hide()
  55. $("#consultigImg").attr("src", './image/ions/kefu2.png')
  56. })
  57. // 产品鼠标移入移出
  58. let fls = true
  59. $('#productHov').hover(function () {$("#product").show()},function () {
  60. setTimeout(function() {
  61. if(fls) {
  62. $("#product").hide()
  63. }
  64. }, 200)
  65. })
  66. $('#product').hover(function () {
  67. fls = false
  68. $("#product").show()
  69. },function () {
  70. fls = true
  71. $("#product").hide()
  72. })
  73. // 轻松管理
  74. $('#easyManBoxConCli .easyManBoxConCliOne').click(function () {
  75. let index = $(this).index()
  76. let arr = $('#easyManBoxConCli .easyManBoxConCliOne')
  77. if(index != '1' && index != '7') {
  78. for(let i in arr) {
  79. $('#easyManBoxConCli .easyManBoxConCliOne').removeClass('easyOn')
  80. }
  81. $(this).addClass("easyOn")
  82. $('#easyManBoxConImg').attr("src", './image/followup/qing'+(+index + 1)+'.png')
  83. }
  84. })
  85. // 随访管家
  86. $('#housekeeperConZuo .housekeeperConZuoLi').click(function () {
  87. let index = $(this).index()
  88. let arr = $('#housekeeperConZuo .housekeeperConZuoLi')
  89. for(let i in arr) {
  90. $('#housekeeperConZuo .housekeeperConZuoLi').removeClass('housekeeperOn')
  91. }
  92. $(this).addClass("housekeeperOn")
  93. $('#housekeeperrText').text($(this).text())
  94. console.log(index)
  95. $('#housekConImg').attr("src", './image/followup/suifangs'+ index +'.png')
  96. })