It seems I get a problem with commas. I have a page with several bookmarks, and my script doesn't work on that page.
So, I have bookmarks on page data-bookmarks="hide,mission"
"hide" - should hide menu by code below
$(document).on('newPage', function(e, data){
switch($('.page').eq(data.index).attr('data-bookmarks')){
case 'hide':
$('.js-button').fadeOut( "slow" );
break;
default:
$('.js-button').fadeIn( "slow" );
}
});
And "mission" is for link to page by menu
function goToBookmark(bname){
window.top.nav.to($("[data-bookmarks*='" + bname + "']").index()+1);
}
$('#mission').click(function(){ goToBookmark('mission'); });
});
So, linking is working, but hiding is not.