alvarotrigo / pagePiling.js

pagePiling plugin by Alvaro Trigo. Create a scrolling pile of sections. http://alvarotrigo.com/pagePiling/
4.1k stars 654 forks source link

Anchored link not redirect to selected page #208

Closed mohamedellithy closed 3 years ago

mohamedellithy commented 3 years ago

my js /------------------------- Page Pilling -------------------------/ function pagePilling(){

    "use strict";

    var ids = [];
    var tooltips = [];
    var colors = [];
    $('.section').each(function () {
        ids.push(this.id+'-page');
        tooltips.push($(this).data("navigation-tooltip"));
        colors.push($(this).data("navigation-color"));
    });
    $('#pagepiling').pagepiling({
        sectionsColor: colors,
        anchors: ids,
        menu: '#myMenu',
        direction: 'vertical',
        verticalCentered: true,
        navigation: {
            'position': 'right',
            'tooltips': tooltips
        },
        loopBottom: true,
        loopTop: true,
        scrollingSpeed: 700,
        easing: 'swing',
        css3: true,
        normalScrollElements: null,
        normalScrollElementTouchThreshold: 5,
        touchSensitivity: 5,
        keyboardScrolling: true,
        sectionSelector: '.section',
        animateAnchor: true,
        //events
        /*afterRender: function() {},
        afterLoad: function(anchorLink, index) {}*/
        afterRender: function(){
                $('#pp-nav').addClass('custom');
            },
        afterLoad: function(anchorLink, index){
            if(index>1){
                $('#pp-nav').removeClass('custom');
            }else{
                $('#pp-nav').addClass('custom');
            }
        }
    });
}
mohamedellithy commented 3 years ago

and anchor not redirect to my select page

alvarotrigo commented 3 years ago

Read the docs where it says:

Be careful! data-anchor tags can not have the same value as any ID element on the site (or NAME element for IE).

mohamedellithy commented 3 years ago

my anchor name is "services-page" or anything "*-page" and it is unique problem not solved !