office.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. $(function(){
  2. var mySwiper = new Swiper('.js_officeLise_list', {
  3. autoplay: false,//可选选项,自动滑动
  4. slidesPerView : 1,
  5. slidesPerGroup : 1,
  6. pagination : '.swiper-pagination',
  7. paginationClickable :true,
  8. noSwiping : true,
  9. autoHeight: true, //高度随内容变化
  10. paginationBulletRender: function (swiper, index, className) {
  11. return '<span class="' + className + '">' + (index + 1) + '</span>';
  12. }
  13. })
  14. setTimeout(function(){
  15. var mySwiperadv = new Swiper(".js_officeHot_list",{
  16. loop : true,
  17. autoplay: 8000,//可选选项,自动滑动
  18. slidesPerView : 'auto',
  19. slidesPerGroup : 1,
  20. pagination : '.officeHot_list_main .swiper-pagination',
  21. paginationClickable :true,
  22. onSetTranslate: function(swiper,translate){
  23. //自定义事件
  24. if(swiper.translate < 0 && swiper.realIndex > 0) {
  25. var TR=swiper.translate
  26. $(".js_officeHot_list ul").css({
  27. 'transform': 'translate3d('+(TR+25)+'px, 0px, 0px)'
  28. })
  29. }
  30. },
  31. });
  32. },2000)
  33. var _i=0;
  34. var _length=$('.js_show_list ul li').length;
  35. var _text='';
  36. var _ico='';
  37. var _name='';
  38. $('.js_show_list ul li').on('mouseover',function(){
  39. _text=$(this).find('.l_img').attr('data-text');
  40. _ico=$(this).find('.l_img img').attr('src');
  41. _name=$(this).find('.name').html();
  42. _i=$(this).index();
  43. $(this).addClass('on').siblings().removeClass('on');
  44. _Ihtml(_ico,_text,_name);
  45. })
  46. var interval;
  47. function myimg() {
  48. //通过i改变图片的名称从而实现图片自动切换
  49. if (_i < 4) {
  50. _i++;
  51. } else {
  52. _i = 0; //当i超出是重新赋值使其实现循环切换图片
  53. }
  54. //通过id获取图片并给它的src属性重新赋值
  55. _text=$('.js_show_list ul li').eq(_i).find('.l_img').attr('data-text');
  56. _ico=$('.js_show_list ul li').eq(_i).find('.l_img img').attr('src');
  57. _name=$('.js_show_list ul li').eq(_i).find('.name').html();
  58. $('.js_show_list ul li').eq(_i).addClass('on').siblings().removeClass('on');
  59. _Ihtml(_ico,_text,_name);
  60. }
  61. //启动定时器,给它一定的时间(毫秒)
  62. interval=setInterval(myimg,5000);
  63. $('.officeTeam_center').on({
  64. mouseover: function() {
  65. clearTimeout(interval); //关闭定时器
  66. },
  67. mouseleave: function() {
  68. interval = setInterval(myimg, "5000"); //启动定时器
  69. }
  70. });
  71. function _Ihtml(img,text,name){
  72. $('.officeTeam_center_show').html('');
  73. var _list=''
  74. _list+='<div class="show-main">';
  75. _list+='<div class="left_ico">';
  76. _list+='<img src="'+img+'" alt="">';
  77. _list+='</div>';
  78. _list+='<div class="right_text">';
  79. _list+='<p class="name">'+name+'</p>';
  80. _list+='<p class="text_m">'+text+'</p>';
  81. _list+='<a onclick="$53click()" href="javascript:;">立即咨询</a>';
  82. _list+='</div>';
  83. _list+='</div>';
  84. $('.officeTeam_center_show').html(_list);
  85. }
  86. $('.js_buttomBm').on('click',function(){
  87. var _hid=$(this).attr('data-hid')
  88. $('.applekf').show(20);
  89. $('.applekfBG').show();
  90. $('.applekf_form input[name="hid"]').val(_hid);
  91. })
  92. $('.applekfBG,.applekf_gb').on('click',function(){
  93. _clickHide();
  94. })
  95. function _clickHide(){
  96. $('.applekf').hide();
  97. $('.applekfBG').hide();
  98. }
  99. //调用方法二(传对象函数)
  100. var fun = {
  101. "error" : function(){
  102. PublicAction.hint("提交末成功!"); //编写需要操作的方法
  103. },
  104. "success" : function(){
  105. PublicAction.hint("提交成功!"); //编写需要操作的方法
  106. $('body input[type="text"]').val('');
  107. _clickHide();
  108. }
  109. }
  110. PublicAction.AjaxSend({CORID:'js_submitBox'},fun);
  111. })