1
jsfiddle鏈接:http://jsfiddle.net/u9gpsb8h/20/ 我想基於jquery標籤滑塊過濾表。jquery多標籤滑塊過濾器表變更
類似的查詢顯示TR其中TD1
我有兩個滑塊1和2,現在我想根據滑塊值滑塊進行過濾表表示過濾器和滑塊2代表濾波器B。
問題是,我的代碼工作正常,當前標籤時只
下面是我的js代碼
$(function() {
$("#slider1").slider({
value: 20,
min:0,
max:20,
orientation: "horizontal",
range: "min",
animate: true,
slide: function(event, ui) {
$('#s1').html(jQuery('#slider1').slider('value'));
// in this function we can define what happens when a user changes the sliders
var table = document.getElementById("theTable");
for (var i = 1, row; row = table.rows[i]; i++) {
//iterate through rows (we SKIP the first row: counter starts at 1!)
for (var j = 0, col; col = row.cells[j]; j++) {
//iterate through columns: if first column not in range: HIDE, else SHOW
if (j == 0) { // if first column
if ($(col).html() <= jQuery('#slider1').slider('value')) {
// if in interval
$(row).show();
} else {
$(row).hide();
}
}
}
}
}
});
$("#slider2").slider({
value: 20,
min:0,
max:20,
orientation: "horizontal",
range: "min",
animate: true,
slide: function(event, ui) {
$('#s2').html(jQuery('#slider2').slider('value'));
// in this function we can define what happens when a user changes the sliders
var table = document.getElementById("theTable");
for (var i = 1, row; row = table.rows[i]; i++) {
//iterate through rows (we SKIP the first row: counter starts at 1!)
for (var j = 0, col; col = row.cells[j]; j++) {
//iterate through columns: if first column not in range: HIDE, else SHOW
if (j == 1) { // if first column
if ($(col).html() <= jQuery('#slider2').slider('value')) {
// if in interval
$(row).show();
} else {
$(row).hide();
}
}
}
}
}
});
});
我如何可以根據滑塊值排序表我是新手請指導我做這件事
您是否嘗試對每個增量的列進行排序?每個增量更正確的排序?不明白這個問題。 – JazzCat
是的,只要完成幻燈片排序 – mydeve
那麼爲什麼要使用滑塊,不會有按鈕的工作,爲什麼你需要一個滑塊,如果排序將只發生一次? – JazzCat