diff --git a/src/index.html b/src/index.html index 92aa867..b456469 100644 --- a/src/index.html +++ b/src/index.html @@ -296,15 +296,15 @@ jQuery(document).ready(function($){
@@ -327,7 +327,7 @@ jQuery(document).ready(function($){
@@ -340,7 +340,7 @@ jQuery(document).ready(function($){ @@ -354,7 +354,7 @@ jQuery(document).ready(function($){ @@ -367,7 +367,7 @@ jQuery(document).ready(function($){ @@ -380,7 +380,7 @@ jQuery(document).ready(function($){ @@ -393,7 +393,7 @@ jQuery(document).ready(function($){ @@ -406,7 +406,7 @@ jQuery(document).ready(function($){ diff --git a/src/product/index.html b/src/product/index.html index c1fceff..2a2b8a3 100644 --- a/src/product/index.html +++ b/src/product/index.html @@ -292,6 +292,18 @@ jQuery(document).ready(function($) { }); }); +var LocString = String(window.document.location.href); +function getUrlParam(name) { + var rs = new RegExp("(^|)" + name + "=([^&]*)(&|$)", "gi").exec(LocString), tmp; + if (tmp = rs) { + return decodeURI(tmp[2]); + } + return ""; +} + +var tab = getUrlParam("tab") || 1 +console.log(tab) + const menuList = ['茶叶包装','酒类包装','医疗保健包装','美妆护肤包装','3C数码包装','节日礼盒/礼品袋','纸箱包装','书刊画册']; const menu = document.getElementById('menu'); // li里面嵌一层div,制造border左右缩进效果 @@ -315,6 +327,8 @@ for (let i = 0; i < menuList.length; i++) { menu.appendChild(liEle) } + + function init(i = 0){ const content = document.getElementById('content'); const children = content.children; @@ -337,7 +351,8 @@ function init(i = 0){ targetMenuImg.src = '../skin/images/rhombus_black.png' } -init() +var tab = Number(getUrlParam("tab")) || 0 +init(tab)