Home › Forums › WoodMart support forum › Sidebar Filter Attributes Collapse › Reply To: Sidebar Filter Attributes Collapse
March 3, 2019 at 12:19 am
#110635
webresultat
Participant
Just searched a bit.
Would something like this be possible if an ID can be set for the layered nav widget?
var limit = 10;
var list = $("#attribute_list");
var more = 0;
function tricky_hide(){
var morec = 0;
$("li", list).each(function(index) {
if (index >= limit) {
$(this).hide();
morec = index - limit + 1;
}
});
if (!more) more = morec;
if (more) {
list.append('<li class="more">' + more + ' more</li>');
return true;
}
return false;
}
if (tricky_hide()) {
list.live("mouseover", function() {
$("li", list).each(function(index) {
$(this).show();
});
$("li.more", list).hide();
});
list.live("mouseout", function() {
tricky_hide();
});
}