2
我已經創建了一個基於jQuery的選項卡式內容,其中點擊選項卡更改下面的內容,但我有一個問題,從SEO角度來看,我一直由SEO人員指導它搜索引擎優化友好,並使其搜索引擎優化友好我將不得不通過每個標籤上的不同網址。JQuery選項卡式內容 - SEO友好URL
有人可以指導我如何通過每一次的URL,例如
如果選項卡2點擊,那麼它應該是與問號的URL添加第二個標籤的http://codepen.io/sanjeevks121/pen/wzoBmy?Tab2
標題
這裏是Codepen
$(document).ready(function(){
\t
\t $('ul.tabs li').click(function(){
\t \t var tab_id = $(this).attr('data-tab');
\t \t $('ul.tabs li').removeClass('current');
\t \t $('.tab-content').removeClass('current');
\t \t $(this).addClass('current');
\t \t $("#"+tab_id).addClass('current');
\t })
})
body {
\t margin-top: 100px;
\t font-family: 'Trebuchet MS', serif;
\t line-height: 1.6
}
.container {
\t width: 800px;
\t margin: 0 auto;
}
ul.tabs {
\t margin: 0px;
\t padding: 0px;
\t list-style: none;
}
ul.tabs li {
\t background: none;
\t color: #222;
\t display: inline-block;
\t padding: 10px 15px;
\t cursor: pointer;
}
ul.tabs li.current {
\t background: #ededed;
\t color: #222;
}
.tab-content {
\t display: none;
\t background: #ededed;
\t padding: 15px;
}
.tab-content.current {
\t display: inherit;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<div class="container">
<ul class="tabs">
<li class="tab-link current" data-tab="tab-1">Tab One</li>
<li class="tab-link" data-tab="tab-2">Tab Two</li>
<li class="tab-link" data-tab="tab-3">Tab Three</li>
<li class="tab-link" data-tab="tab-4">Tab Four</li>
</ul>
<div id="tab-1" class="tab-content current"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </div>
<div id="tab-2" class="tab-content"> Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </div>
<div id="tab-3" class="tab-content"> Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div>
<div id="tab-4" class="tab-content"> Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </div>
</div>
<!-- container -->
我已經修改代碼。 –
謝謝,我會嘗試更新代碼吧! –