I would like to know if there is any way to do it, because I have a function that when I click on a menu button it captures via jquery the page id but if example I am in the HOME page that has no id and is for service page which has id it a reload and my action does not work has some way seila storage in the seila coookies?
$('.sub-menu a').click(function() {
var anchor;
var link = $(this).attr('href');
if (link.indexOf('#') !== -1) {
anchor = '#' + link.split('#').pop();
console.log('anchor',anchor);
}
$('.id-sub').slideUp(2000);
if (anchor !== undefined) {
$(anchor).slideDown(2000).addClass('fixed');
$('html,body').animate({ 'scrollTop': $(anchor) }, 600, function(){
window.location.hash = target;
})
}
});
Because the next thing I need to hide is all the contents that are in the class ('.id-sub')
more when I left the HOME page and click on the SERVICE page it had to show me only the ID that I clicked and hide the rest of the content more like the page of the reload it hides everything and does not show the id that I clicked