4
<li class="main_li">
<a id="post_youowe" onclick="addremoveclass('youowe')" class="main_menu changetxt2" href='javascript:void(0)'>
<span class="showme">Your Owe</span>
<span class="hideme">Outstanding</span>
</a>
<ul class="sub_ul">
<li id="post_housingloan"><a class="sub_inner close_menu" href='javascript:void(0)' onclick="addremoveclass('housingloan')">Home Loans 55</a> </li>
<li id="post_carloan"><a class="sub_inner close_menu" href='javascript:void(0)' onclick="addremoveclass('carloan')">Car Loans</a></li>
<li id="post_personalloan"><a class="sub_inner close_menu" href='javascript:void(0)' onclick="addremoveclass('personalloan')">Personal Loans</a> </li>
<li id="post_creditcards"><a class="sub_inner close_menu" href='javascript:void(0)' onclick="addremoveclass('creditcards')">Credit Cards</a> </li>
</ul>
</li>
腳本我用:點擊UL標題更改?
function addremoveclass(id) {
$("li").removeClass('active');
$("#post_" + id + "").addClass('active');
$('.result_col').hide();
$('#tab' + id + '').fadeIn();
$('.hideme').hide();
$('.showme').show();
var check = $("#post_" + id + "").parent().find(".sub_ul:visible").length;
if (!check) {
$("#post_" + id + "").find('.hideme').show();
$("#post_" + id + "").find('.showme').hide();
}
}
每當我點擊標題內從「優秀」到「你欠」的主要方位的變化。我希望每當我點擊內部標題時,標題欄就會顯示爲「優秀」,並且當我最小化標題按鈕時,只顯示「你欠」。
請,創建 –
你在談論的標籤在這裏https://jsfiddle.net/?但他們在哪裏?請創建一個小提琴並將其張貼在這裏。 –