0
在頁面加載,我只顯示一維數據(缺省數據),現在當上相應的標籤如何顯示與之相關的特定點擊的選項卡如何顯示相關數據點擊李標籤
數據的用戶點擊我的示例代碼
function fetchTopLosersData(tabclicked) {
var htmldatafortoploosers = '';
htmldatafortoploosers += '<thead><th class="thheaders">Symbol</th></thead><tbody>';
if (tabclicked === '#1d') {
for (var i = 0; i < samplejson1day.length; i++) {
var symbol = samplejson1day[i].symbol;
htmldatafortoploosers += '<tr> <td>' + symbol + '</td>';
}
} else if (tabclicked === '#1w') {
for (var i = 0; i < samplejson1week.length; i++) {
var symbol = samplejson1week[i].symbol;
htmldatafortoploosers += '<tr> <td>' + symbol + '</td>';
}
}
else if (tabclicked === '#2w') {
for (var i = 0; i < samplejson2week.length; i++) {
var symbol = samplejson2week[i].symbol;
htmldatafortoploosers += '<tr> <td>' + symbol + '</td>';
}
}
else if (tabclicked === '#3w') {
for (var i = 0; i < samplejson3week.length; i++) {
var symbol = samplejson3week[i].symbol;
htmldatafortoploosers += '<tr> <td>' + symbol + '</td>';
}
}
$(tabclicked).html(htmldatafortoploosers);
}
這是我的小提琴
https://jsfiddle.net/gr1L23us/13/
你能告訴我怎麼顯示與該標籤數據只有
這是你想要什麼? https://jsfiddle.net/mohamedyousef1980/gr1L23us/14/ –
是的,這就是我想要的,非常感謝你... – Pawan