我有用于带有锚点的滑动页面的分页 jquery 并且工作得很好,但我想让它运行 whitout 来自 url ex: www.mysite.com/#aboutme <- 的 # 页面,点击
在此处查看插件:https ://github.com/alvarotrigo/pagePiling.js
这是我到目前为止所拥有的:
HTML:
<div class="collapse navbar-collapse sub-menu-bar" id="navbarSupportedContent">
<ul class="navbar-nav m-auto">
<li data-menuanchor="home" class="active"> <a href="">Home</a></li>
<li data-menuanchor="aboutme"><a href="#despremine">About me</a></li>
</ul>
</div>
JS:
var myAnchors = [];
$( ".navbar-nav > li" ).each(function( index ) { myAnchors.push($(this).attr("data-menuanchor")); });
$('.fullpage-slider').pagepiling({
scrollingSpeed: 280,
navigation:false,
menu: '.fullpage-progress-bar, .navbar-nav',
sectionSelector: '.pp-scrollable',
anchors: myAnchors,
afterRender: function(anchorLink, index){
NavbarColor();
},
afterLoad: function(anchorLink, index){
$('.pp-scrollable .section-number').removeClass('show');
$('.active .section-number').addClass('show');
NavbarColor();
}