Portfolio Filter Off Canvas

Is it possible to close a Content Area Off-Canvas by click on a filter for a portfolio? Can’t work out how to do it.

Basically I have a number of categories which the visitor can click in the off-canvas screen. When they click one of the filters it changes what is displayed on the page, but I would like to upon the click of the filter to close down the off-canvas box.

A previous post (now closed as I only saw the reply recently) gave this as a solution:

jQuery ( function($) {
$(’#custom-close’).click(function(){
$(’#my-off-canvas-off-canvas button’).click();

});

} );

This is fine with a text link or button but I can’t seem to work out how to add an ID to the portfolio filter shortcode to get it to work.

Any help would be appreciated.

Hello @oitproductions,

Thanks for writing in!

The portfolio filter does not have an ID. You may use the class instead.

jQuery ( function($) {
  $('.x-portfolio-filter').click(function(){
    $('#my-off-canvas-off-canvas button').click();
  });
});

Just to manage your expectations, this isn’t specifically a theme issue, but rather, your customisation of it. So whilst I have happily provided you with some guidance above on how to get it working, we cannot provide theme customisation as a general rule, or support custom code solutions provided. Therefore, you might find it helpful to check out the following:

CSS Selector Reference
How to find the css selector in chrome

Hope this helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.