Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /** Disable the All filter and display only one image per filter in JKit Gallery widget */
- (function ($) {
- const wrapper = $('.jeg-elementor-kit.jkit-gallery'),
- grid = wrapper.find('.gallery-items'),
- filter = wrapper.find('.jkit-gallery-control'),
- filter_label = wrapper.find('#search-filter-trigger span'),
- items = grid.find('.gallery-item-wrap:not(:first-child)');
- items.each(function () {
- this.style.display = 'none';
- });
- filter[0].remove();
- filter_label.text(filter[1].textContent);
- filter.each(function () {
- $(this).on('click', function () {
- const target = $($(this).attr('data-filter')),
- target_height = target.css('height');
- target.css('display', '');
- grid.css('height', target_height);
- });
- });
- })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement