時,沒有運氣如何使這些選項卡的內容在單擊選項卡時淡入?
這裏選擇我一直在試圖讓這些選項卡的內容,以淡入的標籤
<div id="homepagetabsdiv"><ul id="homepagetabs"><li id="tab0" onclick="javascript:show_tab('0');">Main</li>
<li id="tab1" title="Drag and drop this tab to re-arrange the order" onclick="javascript:show_tab('1');">managers</li>
<li id="tab2" title="Drag and drop this tab to re-arrange the order" onclick="javascript:show_tab('2');">Standings</li>
</ul></div>
<div id="tabcontent0" class="homepagetabcontent">CONTENT</div>
<div id="tabcontent1" class="homepagetabcontent">CONTENT</div>
<div id="tabcontent2" class="homepagetabcontent">CONTENT</div>
編輯添加showtab功能
function show_tab (tab_id) {
var done = false;
var counter = 0;
while (! done) {
var this_tab_content = document.getElementById("tabcontent" + counter);
var this_tab = document.getElementById("tab" + counter);
if (! this_tab_content) {
done = true;
} else {
if (counter == tab_id) {
this_tab_content.style.display = '';
this_tab.className = "currenttab";
} else {
this_tab_content.style.display = 'none';
this_tab.className = "";
}
}
counter++;
}
location.hash = tab_id;
}
有你閱讀和使用過的嘗試'.fadeIn()'根據API? http://api.jquery.com/fadeIn/ – Mal 2013-04-08 00:50:15
小心分享您的Javascript代碼?特別是'show_tab'? – Ian 2013-04-08 00:53:21
編輯追加,TY伊恩 – user2250423 2013-04-08 01:15:50