Перейти к содержимому


Фотография
- - - - -

Expandable list


Лучший Ответ Kess , 27 October 2013 - 19:36

Ok, Iv'e changed the script to suit your needs better:

jQuery(document).ready(function() {
    jQuery(".filter-fields .filter-inline .element-jqueryui .field").each(function() {
        if (jQuery(this).find("input").length > 3) {
            jQuery(this).after( "<div class='toggleheight'>&#9660;</div>" );        
        }
    });
    jQuery(".toggleheight").click(function(e){
        jQuery(this).prev().toggleClass("expanded");
        e.stopPropagation();
    });
    jQuery('html').click(function() {
        jQuery(".filter-fields .expanded").removeClass("expanded");
    });
});

This will solve #1 and #2

 

 

For your last request just add this css:

.expanded + .toggleheight {
    display: none;
}

I don't know about #3. I've asked our developers about that.

Перейти к сообщению


  • Закрытая тема Тема закрыта
Сообщений в теме: 10

#11 Kess

Kess

Отправлено 05 November 2013 - 07:08

Hello,

 

I'll give you two methods so you'll be able to choose which one suits you better.

 

1.

 

This is the simplest one.

 

This goes to css:

.pg-filter {
    display: none;
}

I'm not 100% sure about this selector - I don't know if you use it somewhere else on the website. The idea is to select a block with the filter.

 

And add this script:

jQuery(document).ready(function() {
    jQuery(".pg-filter").css("display", "block");	
});

I guess it's better to put this script after other scripts that affects the filter.

 

So this solution will just completely hide that filter until the page is loaded and display it later.

 

 

2.

 

This solution is smoother. I like it more.

 

css:

.pg-filter {
    visibility: hidden;
}

js:

jQuery(document).ready(function() {
    setTimeout(function() {
        jQuery(".pg-filter").css("visibility", "visible").hide().fadeIn(500);
    }, 500);	
});

Try them both, just not at the same time. And in case something else will disappear, try to change ".pg-filter" selector to something else, both in css and jQuery.


  • 0




Click to return to top of page in style!