Home Forums WoodMart support forum Sidebar Filter Attributes Collapse Reply To: Sidebar Filter Attributes Collapse

#110635

webresultat
Participant

Just searched a bit.
Would something like this be possible if an ID can be set for the layered nav widget?

http://jsfiddle.net/MYM2C/

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();
    });
}