浏览代码

add fb line link

SyuanYu 2 年之前
父节点
当前提交
31ee0910d1
共有 2 个文件被更改,包括 14 次插入4 次删除
  1. 2 2
      layouts/collection/single.html
  2. 12 2
      themes/hugo-universal-theme-master/static/js/bhouse.js

+ 2 - 2
layouts/collection/single.html

@@ -77,8 +77,8 @@
             <div class="d-flex justify-content-between align-items-center">
                 <span></span>
                 <div class="icon-box">
-                    <a href="" id="collection_icon_fb"><img src="/img/icon_fb@2x.png" alt=""></a>
-                    <a href="" id="collection_icon_line"><img src="/img/icon_line@2x.png" alt=""></a>
+                    <a href="" id="collection_icon_fb" target="_blank"><img src="/img/icon_fb@2x.png" alt=""></a>
+                    <a href="" id="collection_icon_line" target="_blank"><img src="/img/icon_line@2x.png" alt=""></a>
                 </div>
             </div>
             <div class="row px-0 mx-0">

+ 12 - 2
themes/hugo-universal-theme-master/static/js/bhouse.js

@@ -42,7 +42,7 @@ window.onload = function() {
         "margin": 'auto',
       });
     }
-    
+
     if (i === imgCount-1) {
       $('#slider-loading').addClass("slider_loading");
       $('.style_house_sec02').css("height", "auto");
@@ -220,4 +220,14 @@ $('.furniture_design_content .slider-nav').slick({
   slidesToScroll: 1,
   asNavFor: '.slider-for',
   focusOnSelect: true
-});
+});
+
+// 外部連結
+let fb_link = `https://www.facebook.com/sharer.php?u=${location.href}`;
+let collection_icon_fb = document.getElementById('collection_icon_fb');
+$("#collection_icon_fb").attr("href",fb_link);
+
+let line_link = `http://line.naver.jp/R/msg/text/?${location.href}`;
+let collection_icon_line = document.getElementById('collection_icon_line');
+
+$("#collection_icon_line").attr("href",line_link);