소스 검색

详情页客户案例链接跳转

samhoo 6 년 전
부모
커밋
032d71274e

+ 14 - 0
jpress-web-template-usoftchina/src/main/webapp/templates/usoftchina/assets/js/test.js

@@ -0,0 +1,14 @@
+setTimeout(()=>{
+    var customerCase = document.getElementById("customerCase");
+    documentSize();
+    window.addEventListener('resize', ()=>{
+        documentSize();
+    });
+    function documentSize(){
+        if(document.body.clientWidth<583){
+            customerCase.setAttribute("href","/jpress/customerCaseMo");
+        }else{
+            customerCase.setAttribute("href","/jpress/customerCase");
+        }
+    };
+})

+ 2 - 1
jpress-web-template-usoftchina/src/main/webapp/templates/usoftchina/content_customers.html

@@ -177,6 +177,7 @@
 </#macro>
 <head>
     <link rel="stylesheet" href="${CTPATH}/assets/css/customerDeMo.css" />
+    <script src="${CTPATH}/assets/js/test.js"></script>
 </head>
 
 <@layout>
@@ -197,7 +198,7 @@
                 <ul>
                     <li><a href="#">当前位置:</a></li>
                     <li><a href="${CPATH}/">首页</a>&gt;</li>
-                    <li><a href="${CPATH}/customerCase">企业案例</a>&gt;</li>
+                    <li><a id="customerCase" href="${CPATH}/customerCase">企业案例</a>&gt;</li>
                     <li><a href="#">${(content.getMetadataByKey("company_name"))!}(
                         <@jp.taxonomys module="customers">
                         <#list taxonomys as taxonomy>