info.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. var qrcode = new QRCode(document.getElementById("qrcode"), {
  2. width: 100,
  3. height: 100
  4. });
  5. // url生成二维码
  6. if($(".az_code_right").length>0){
  7. var qrcode_title = new QRCode(document.getElementById("qrcode_title"), {
  8. width : 100,
  9. height : 100
  10. });
  11. }
  12. $(function () {
  13. var p_text1 = $("#code_url").text();
  14. if($(".az_code_right").length>0){
  15. qrcode_title.makeCode(p_text1);
  16. }
  17. $(".public_nav li").removeClass('current_page').eq(1).addClass('current_page');
  18. $("#J_rank_list").load('/Layout/gameRankList');
  19. });
  20. // 安卓下载按钮
  21. $(".az_code_right .az_ed_download").hover(function () {
  22. $(".az_ed_download img").attr("src", "/static/images/home/az-white.png");
  23. }, function () {
  24. $(".az_ed_download img").attr("src", "/static/images/home/SVG-07.png");
  25. });
  26. $(".az_no_link .az_no_download").hover(function () {
  27. $(".az_no_download img").attr("src", "/static/images/home/az-white.png");
  28. }, function () {
  29. $(".az_no_download img").attr("src", "/static/images/home/SVG-19.png");
  30. });
  31. $(".az_no_download").click(function () {
  32. $(".warp_no_download_popup").show();
  33. })
  34. // 手游排行控件显示隐藏
  35. $(function () {
  36. $('.rank_list>div').eq(0).find('.big').show()
  37. $('.rank_list>div').eq(0).find('.small').hide()
  38. $('.rank_list').hover(function () {
  39. $('.rank_list>div').hover(function () {
  40. $(this).find('.big').show().parent().siblings().find('.big').hide();
  41. $(this).find('.small').hide().parent().siblings().find('.small').show();
  42. });
  43. });
  44. })
  45. // 判断截图是否超过框
  46. setTimeout(function () {
  47. if($(".outer").length>0){
  48. var c = $('.image-slider-contents').width();
  49. var d = $(".contents-wrapper .outer:last").attr('class');
  50. var array = d.split(" ");
  51. var e = array[0];
  52. var w = (e * 268) + (15 * (e - 1));
  53. $(".contents-wrapper .outer:last").css("margin-right", "0px")
  54. $(".contents-wrapper").css("width", w);
  55. var b = $(".contents-wrapper").width();
  56. if (b <= c) {
  57. $(".image-slider-back,.image-slider-forward").css("cssText", "display:none !important;")
  58. } else {
  59. $(".contents-wrapper").css("width", w);
  60. }
  61. }
  62. }, 500);
  63. // 游戏截图轮番图
  64. $(document).ready(function () {
  65. var a = $('.image-slider-contents').width();
  66. $('.image-slider-contents').on('scroll', function () {
  67. if ($(this).scrollLeft() === 0) {
  68. $(".image-slider-back").css("background", "url(/static/images/home/left-gray.png)");
  69. $(".image-slider-forward").css("background", "url(/static/images/home/right.png)");
  70. } else if (($(this).width() + $(this).scrollLeft()) === $('.contents-wrapper').width()) {
  71. $(".image-slider-back").css("background", "url(/static/images/home/left.png)");
  72. $(".image-slider-forward").css("background", "url(/static/images/home/right-gray.png)");
  73. } else {
  74. $(".image-slider-back").css("background", "url(/static/images/home/left.png)");
  75. $(".image-slider-forward").css("background", "url(/static/images/home/right.png)");
  76. }
  77. });
  78. var isrightclick = true;
  79. $(".image-slider-forward").on("click", function () {
  80. if (isrightclick) {
  81. isrightclick = false;
  82. $('.image-slider-contents').animate({ scrollLeft: $('.image-slider-contents').scrollLeft() + a }, 500);
  83. setTimeout(function () {
  84. isrightclick = true;
  85. }, 500);
  86. }
  87. });
  88. var isleftclick = true;
  89. $(".image-slider-back").on("click", function () {
  90. if (isleftclick) {
  91. isleftclick = false;
  92. $('.image-slider-contents').animate({ scrollLeft: $('.image-slider-contents').scrollLeft() - a }, 500);
  93. setTimeout(function () {
  94. isleftclick = true;
  95. }, 500);
  96. }
  97. });
  98. });
  99. // 点击放大图其他位置隐藏
  100. $(document).click(function (e) {
  101. var target = $(e.target);
  102. if (target.closest(".img-large").length != 0) return;
  103. $(".preview").hide();
  104. $('.preview .img-large img').removeAttr('class');
  105. })
  106. //判断截图是否超过1张
  107. setTimeout(function () {
  108. if (!$('.image-slider-contents .outer').hasClass('2')) {
  109. $(".left").hide();
  110. $(".right").hide();
  111. }
  112. }, 200)