猎豆优选官网

movejs.js 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. var flag = false;
  2. swiperPage();
  3. function swiperPage () {
  4. var mySwiper = new Swiper(".swiper-container", {
  5. direction: "vertical", //纵向展示
  6. // pagination: ".swiper-pagination", //小点
  7. //virtualTranslate : true,
  8. mousewheelControl: true,
  9. onInit: function(swiper) {
  10. swiperAnimateCache(swiper);
  11. swiperAnimate(swiper);
  12. },
  13. onSlideChangeEnd: function(swiper) {
  14. swiperAnimate(swiper);
  15. },
  16. onTransitionEnd: function(swiper) {
  17. swiperAnimate(swiper);
  18. },
  19. watchSlidesProgress: true,
  20. onProgress: function(swiper) {
  21. for (var i = 0; i < swiper.slides.length; i++) {
  22. var slide = swiper.slides[i];
  23. var progress = slide.progress;
  24. var translate = progress * swiper.height / 4;
  25. var scale = 1 - Math.min(Math.abs(progress * 0.5), 1);
  26. var opacity = 1 - Math.min(Math.abs(progress / 2), 0.5);
  27. slide.style.opacity = opacity;
  28. var es = slide.style;
  29. es.webkitTransform = es.MsTransform = es.msTransform = es.MozTransform = es.OTransform = es.transform =
  30. "translate3d(0," +
  31. translate +
  32. "px,-" +
  33. translate +
  34. "px) scaleY(" +
  35. scale +
  36. ")";
  37. }
  38. },
  39. onSetTransition: function(swiper, speed) {
  40. for (var i = 0; i < swiper.slides.length; i++) {
  41. var es = swiper.slides[i].style;
  42. es.webkitTransitionDuration = es.MsTransitionDuration = es.msTransitionDuration = es.MozTransitionDuration = es.OTransitionDuration = es.transitionDuration =
  43. speed + "ms";
  44. }
  45. }
  46. });
  47. }
  48. function downloadApp () {
  49. if(navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)){
  50. window.location.href='https://itunes.apple.com/cn/app/id1391124408?mt=8';
  51. }
  52. if(navigator.userAgent.match(/android/i)){
  53. if(navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == "micromessenger"){
  54. //微信
  55. showMsg()
  56. }else if (navigator.userAgent.toLowerCase().match(/WeiBo/i) == "weibo"){
  57. //新浪微博
  58. showMsg()
  59. }else if (navigator.userAgent.toLowerCase().match(/QQ/i) == "qq"){
  60. //qq空间
  61. showMsg()
  62. }else{
  63. window.location.href='http://apitbk.726p.com/liedou_android.apk';
  64. }
  65. }
  66. }
  67. function showMsg() {
  68. flag = true;
  69. setTimeout(function() {
  70. flag = false
  71. }, 3000);
  72. }
  73. var alertInfo = document.getElementsByClassName("alert-info")[0];
  74. if(flag){
  75. alertInfo.style.display = "block";
  76. }else{
  77. alertInfo.style.display = "none";
  78. }