goto.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. // axios
  2. // axios.get('http://172.105.205.52:8000/courses?tag_string=(2)')
  3. // .then(function (response) {
  4. // console.log(response);
  5. // });
  6. // axios.post('/user', {
  7. // firstName: 'Fred',
  8. // lastName: 'Flintstone'
  9. // }).then(function (response) {
  10. // console.log(response);
  11. // })
  12. $( "#1" ).click(function() {
  13. $.ajax('http://172.105.205.52:8000/tags', {
  14. type: 'GET', // http method
  15. headers: { 'Access-Control-Allow-Origin': '*' },
  16. success: function (res) {
  17. var myJSON = JSON.stringify(res);
  18. // var a = res;
  19. // console.log(res);
  20. var d = JSON.parse(myJSON);
  21. console.log(d[0].name);
  22. },
  23. error: function (err) {
  24. console.log(err);
  25. }
  26. });
  27. });
  28. // $( "#2" ).click(function() {
  29. // $.ajax('http://172.105.205.52:8000/tags', {
  30. // type: 'GET', // http method
  31. // headers: { 'Access-Control-Allow-Origin': '*' },
  32. // success: function (res) {
  33. // var myJSON = JSON.stringify(res);
  34. // // var a = res;
  35. // // console.log(res);
  36. // var d = JSON.parse(myJSON);
  37. // console.log(d[1].name);
  38. // },
  39. // error: function (err) {
  40. // console.log(err);
  41. // }
  42. // });
  43. // });
  44. // $( "#3" ).click(function() {
  45. // $.ajax('http://172.105.205.52:8000/tags', {
  46. // type: 'GET', // http method
  47. // headers: { 'Access-Control-Allow-Origin': '*' },
  48. // success: function (res) {
  49. // var myJSON = JSON.stringify(res);
  50. // // var a = res;
  51. // // console.log(res);
  52. // var d = JSON.parse(myJSON);
  53. // console.log(d[2].name);
  54. // },
  55. // error: function (err) {
  56. // console.log(err);
  57. // }
  58. // });
  59. // });
  60. // $( "#4" ).click(function() {
  61. // $.ajax('http://172.105.205.52:8000/tags', {
  62. // type: 'GET', // http method
  63. // headers: { 'Access-Control-Allow-Origin': '*' },
  64. // success: function (res) {
  65. // var myJSON = JSON.stringify(res);
  66. // // var a = res;
  67. // // console.log(res);
  68. // var d = JSON.parse(myJSON);
  69. // console.log(d[3].name);
  70. // },
  71. // error: function (err) {
  72. // console.log(err);
  73. // }
  74. // });
  75. // });
  76. // $( "#5" ).click(function() {
  77. // $.ajax('http://172.105.205.52:8000/tags', {
  78. // type: 'GET', // http method
  79. // headers: { 'Access-Control-Allow-Origin': '*' },
  80. // success: function (res) {
  81. // var myJSON = JSON.stringify(res);
  82. // // var a = res;
  83. // // console.log(res);
  84. // var d = JSON.parse(myJSON);
  85. // console.log(d[4].name);
  86. // },
  87. // error: function (err) {
  88. // console.log(err);
  89. // }
  90. // });
  91. // });
  92. // 手機板menu彈跳視窗
  93. $("#menu-box2").hide();
  94. $("#menu-box").hide();
  95. $(".link").click(function () {
  96. $("#menu-box").fadeOut("slow", function () {
  97. $("#menu-box2").fadeOut("slow");
  98. // Animation complete.
  99. });
  100. });
  101. $("#menu-btn1").click(function () {
  102. $("#menu-box").fadeIn();
  103. $("#menu-box2").fadeIn();
  104. });
  105. $(".close").click(function () {
  106. $("#menu-box").fadeOut();
  107. $("#menu-box2").fadeOut();
  108. });
  109. // sec01 最新課程手機輪播
  110. $('#sec01-moblie-container').slick({
  111. arrows: false,
  112. slidesToShow: 1,
  113. slidesToScroll: 1,
  114. infinite: false,
  115. centerMode: true,
  116. });
  117. $('#sec01-slider-next').click(function () {
  118. $('#sec01-moblie-container').slick('slickNext')
  119. });
  120. // sec04 專欄報導 手機輪播
  121. $('#sec04-moblie-container').slick({
  122. arrows: false,
  123. slidesToShow: 1,
  124. slidesToScroll: 1,
  125. infinite: false,
  126. centerMode: true,
  127. });
  128. $('#sec04-slider-next').click(function () {
  129. $('#sec04-moblie-container').slick('slickNext')
  130. });
  131. // sec03排名table輪播
  132. $('#sec03-slider').slick({
  133. arrows: false,
  134. slidesToShow: 1,
  135. slidesToScroll: 1,
  136. infinite: true,
  137. });
  138. $('#sec03-slider-next').click(function () {
  139. $('#sec03-slider').slick('slickNext')
  140. });