button.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <!-- 右下角按鈕區塊 -->
  2. <button data-gt-target="#top" data-gt-duration="100" data-gt-offset="0" class="gotop-btn" title="GoTop">
  3. <!-- <span class="top_img"></span> -->
  4. <img src="https://hhh.com.tw/hhh_index/images/icon/feather-chevron-right.svg" alt="">
  5. </button>
  6. <!-- <button title="為我推薦設計師" class="d-none d-md-inline" data-ga="Go_To_Request">
  7. <a href="https://hhh.com.tw/about/request/" target="_blank">
  8. <img src="./img/icon/feather-file-text.svg" alt="">
  9. </a>
  10. </button>
  11. <button title="裝修預算評估" class="d-none d-md-inline" data-ga="Go_To_Calculator">
  12. <a href="https://hhh.com.tw/about/calculator/" target="_blank">
  13. <img src="./img/icon/ionic-ios-calculator.svg" alt="" style="width: 22px; margin-left: 3px;">
  14. </a>
  15. </button>
  16. <button title="裝修預算諮詢" class="d-none d-md-inline" data-ga="Go_To_Calculator">
  17. <a href="https://hhh.com.tw/calculator_request/index.html" target="_blank">
  18. <img src="./img/icon/ionic-ios-calculator.svg" alt="" style="width: 22px; margin-left: 3px;">
  19. </a>
  20. </button>
  21. <button title="+好物商城" class="d-none d-md-inline" data-ga="Go_To_Shop">
  22. <a href="https://shop.hhh.com.tw/" target="_blank">
  23. <img src="./img/icon/feather-shopping-cart.svg" alt="">
  24. </a>
  25. </button> -->
  26. <button title="裝修預算諮詢" class="d-none d-md-inline calculator-btn" data-ga="Go_To_Calculator">
  27. <a href="https://hhh.com.tw/calculator_request/index.html" target="_blank">
  28. <img src="https://hhh.com.tw/hhh_index/images/icon/ionic-ios-calculator.svg" alt=""
  29. style="width: 22px; margin-left: 3px;">
  30. <p>裝修計算機</p>
  31. </a>
  32. </button>
  33. <button title="+好物商城" class="d-none d-md-inline shop-btn" data-ga="Go_To_Shop">
  34. <a href="https://shop.hhh.com.tw/" target="_blank">
  35. <img src="https://hhh.com.tw/hhh_index/images/icon/feather-shopping-cart.svg" alt="">
  36. <p>+好物</p>
  37. </a>
  38. </button>
  39. <!-- 暫時隱藏 -->
  40. <!-- <button title="線上諮詢">
  41. <a href="https://hhh.com.tw/about/contact/" target="_blank">
  42. <img src="./images/icon/simple-hipchat.svg" alt="">
  43. </a>
  44. </button> -->
  45. <div class="d-md-none justify-content-evenly mb-menu">
  46. <!-- <section title="為我推薦設計師" data-ga="Go_To_Request">
  47. <a href="https://hhh.com.tw/about/request/" target="_blank">
  48. <img src="./img/icon/feather-file-text.svg" alt="為我推薦設計師">
  49. <h4>填需求</h4>
  50. </a>
  51. </section>
  52. <section title="裝修預算評估" data-ga="Go_To_Calculator">
  53. <a href="https://hhh.com.tw/about/calculator/" target="_blank">
  54. <img src="./img/icon/ionic-ios-calculator.svg" alt="裝修預算評估">
  55. <h4>估預算</h4>
  56. </a>
  57. </section> -->
  58. <section title="裝修計算機" data-ga="Go_To_Calculator">
  59. <a href="https://hhh.com.tw/calculator_request/index.html" target="_blank">
  60. <img src="https://hhh.com.tw/hhh_index/images/icon/calculator_request.svg" alt="裝修計算機">
  61. <h4>裝修計算機</h4>
  62. </a>
  63. </section>
  64. <section title="+好物商城" data-ga="Go_To_Shop">
  65. <a href="https://shop.hhh.com.tw/" target="_blank">
  66. <img src="https://hhh.com.tw/hhh_index/images/icon/feather-shopping-cart.svg" alt="+好物商城">
  67. <h4>+好物</h4>
  68. </a>
  69. </section>
  70. <section data-ga="Go_To_Member">
  71. <a href="https://m.hhh.com.tw/users">
  72. <img src="https://hhh.com.tw/hhh_index/images/icon/material-people.svg" alt="會員"
  73. style="filter: invert(67%) sepia(0%) saturate(0%) hue-rotate(242deg) brightness(91%) contrast(93%);">
  74. <h4>會員</h4>
  75. </a>
  76. </section>
  77. </div>
  78. <script>
  79. $(".gotop-btn").click(() => {
  80. $("html, body").animate(
  81. {
  82. scrollTop: 0,
  83. }, 0
  84. );
  85. });
  86. // 右下按鈕滑入顯示
  87. $(".calculator-btn").hover(function () {
  88. $(".calculator-btn").addClass("show");
  89. }, function () {
  90. $(".calculator-btn").removeClass("show");
  91. });
  92. $(".shop-btn").hover(function () {
  93. $(".shop-btn").addClass("show");
  94. }, function () {
  95. $(".shop-btn").removeClass("show");
  96. });
  97. // 判斷按鈕顯示 or 隱藏
  98. $(window).scroll(function () {
  99. if ($(this).scrollTop()) {
  100. $('#btn-box').fadeIn();
  101. } else {
  102. $('#btn-box').fadeOut();
  103. }
  104. });
  105. // 滑到 footer 區塊隱藏下方選單
  106. // let footerHeight = $("#footer").height();
  107. // let bodyHeight = $("body").height()
  108. // $(window).scroll(function () {
  109. // let height = (bodyHeight - footerHeight) - 600;
  110. // if ($(window).scrollTop() > height) {
  111. // $('.mb-menu').css("opacity", "0");
  112. // } else {
  113. // $('.mb-menu').css("opacity", "1");
  114. // }
  115. // });
  116. </script>
  117. <script>
  118. document.querySelector('button[data-ga="Go_To_Calculator"]').addEventListener('click', function () {
  119. dataLayer.push({
  120. 'event': 'Go_To_Calculator',
  121. 'btn_location': 'FixedBTN'
  122. });
  123. });
  124. document.querySelector('button[data-ga="Go_To_Shop"]').addEventListener('click', function () {
  125. dataLayer.push({
  126. 'event': 'Go_To_Shop',
  127. 'btn_location': 'FixedBTN'
  128. });
  129. });
  130. </script>