0
我意識到產品的字母搜索。在點擊字母時,顯示由該字母開始的所有產品。 但我會把它放在信件的頂部,然後隱藏。jQuery,計數懸停兒童和顯示結果
我不得不使用函數hover()和append()ans如何?
這是我的代碼:
_alphabets.hover(function(){
var _letter = $x(this), _text = $x(this).text(), _count = 0;
_contentRows.removeClass("lignetrouve");
_contentRows.each(function(i) {
var _cellText = $x(this).children('td').eq(0).text();
if (RegExp('^' + _text).test(_cellText)) {
_count += 1;
list = $x(this).addClass("lignetrouve");
}
}); /*end _contentRows.each(function(i) */
//we count number of child
_nblignes = $x('.lignetrouve').length;
//display
$x('.compteur').append(_nblignes);
})
感謝。