home.js 1.88 KB
$(function () {
  var isMobile = document.body.clientWidth <= 768

  //index banner
  $('.banner_index').flexslider({
    animation: 'slide',
    controlNav: !isMobile,
    directionNav: !isMobile,
    keyboard: true,
    slideshow: true,  // Boolean: 是否自动播放
    slideshowSpeed: 5000, // Integer: ms 滚动间隔时间
    animationSpeed: 1000, // Integer: ms 动画滚动速度
    pauseOnAction: false,
    animationLoop: true,
    //pauseOnHover: true,
    //触屏滑动后继续自动轮播
    before: function (slider) {
      slider.pause()
      slider.play()
    }
  })

  // css3
  var isIE = function (ver) {
    ver = ver || ''
    var b = document.createElement('b')
    b.innerHTML = '<!--[if IE ' + ver + ']>1<![endif]-->'
    return b.innerHTML === '1'
  }

  if (isIE(8) || isIE(7)) {

  } else {
    //        动画
    wow = new WOW({
      animateClass: 'animated'
    })
    wow.init()
  }

  var c_width = document.body.clientWidth
  var _index = 0
  if (c_width <= 1920) {
    $('.in1_list ul li').mouseover(function () {
      _index = $(this).index()
      $(this).stop().stop().animate({ width: 530 }, 500).siblings('li').stop().animate({ width: 284 }, 500)
      $(this).addClass('on').siblings().removeClass('on')
    })
  }
  if (c_width <= 1600) {
    $('.in1_list ul li').mouseover(function () {
      _index = $(this).index()
      $(this).stop().stop().animate({ width: 510 }, 500).siblings('li').stop().animate({ width: 230 }, 500)
      $(this).addClass('on').siblings().removeClass('on')
    })
  }

  jQuery('.slideTxtBox').slide({
    effect: 'left',
    // trigger:"click",
    pnLoop: true,
  })

  jQuery('.in3_slide').slide({
    mainCell: '.in3_list ul',
    effect: 'leftLoop',
    autoPlay: true,
    autoPage: true,
    scroll: '1',
    vis: 3,
    prevCell: '.in3btn_prev',
    nextCell: '.in3btn_next'
  })

  // 数字增加

  $('.single-num').countUp()

})