I have a similar problem. And the essence is most likely in something simple.
There is a page where blocks are filtered. It was easier (many times) to create 7 different pages. But it was interesting for me to bring the matter to the end in this way. Maybe now I will redo it ....
Here is the original page https://sibirpotok.ru/service.html
On the left are listed services. When we go to the page all the blocks on the same page. If you click on the menu on the left - the desired block is filtered. It is necessary to imitate that the pages are different. Even if the page is updated, you need to automatically run the script to stay in the same menu item. Otherwise, all the blocks on the same page will fall out again.
I can’t start the buttons even on the same page through the top drop-down menu. And still it is necessary to make start of buttons upon transition from other pages, through the drop-down menu from above.
That's what's on the filter in the jackpot.
// filter items when filter link is clicked $('#filtrable a').on('click', function(e) { var selector = $(this).attr('data-filter'); $container.isotope({ filter: selector, layoutMode : 'fitRows' }); // return false; e.preventDefault(); }); var $optionSets = $('#filtrable li'), $optionLinks = $optionSets.find('a'); $optionLinks.on('click', function(e){ var $this = $(this); // don't proceed if already selected if ( $this.hasClass('selected') ) { // return false; e.preventDefault(); } var $optionSet = $this.parents('#filtrable'); $optionSet.find('.selected').removeClass('selected'); $this.addClass('selected'); // make option object dynamically, ie { filter: '.my-filter-class' } var options = {}, key = $optionSet.attr('data-option-key'), value = $this.attr('data-option-value'); // parse 'false' as false boolean value = value === 'false' ? false : value; options[ key ] = value; if ( key === 'layoutMode' && typeof changeLayoutMode === 'function' ) { // changes in layout modes need extra logic changeLayoutMode( $this, options ) } else { // otherwise, apply new options $container.isotope( options ); } // return false; e.preventDefault(); }); // $(function(){
// // var hash = location.hash.substr (1) // $ ('[data-value = "' + hash + '"]'). click (); // //});
$(function(){ var filter = window.location.hash.replace('#', ''); $('.filter[data-filter="' + filter + '"]').click(); // если у вас есть событие на клик
});
})(jQuery);
At the very bottom, I tried to add the jQuery code I found here. Maybe not add there or not)))
And still tell me where it can be, there are ready-made templates according to the principle to make. And the most important thing is that hosting like a java script does not support.