时,没有运气如何使这些选项卡的内容在单击选项卡时淡入?
这里选择我一直在试图让这些选项卡的内容,以淡入的标签
<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