当使用jquery.fullPage滚动时,如何更改WCircleMenu选项

4
我有这段代码:http://jsfiddle.net/hevercking/t0qxavfc/。当你点击"&"按钮时,使用WCircleMenu效果在按钮顶部显示社交网络链接,当有人向下滚动时,使用jquery.fullPage效果出现菜单栏。到目前为止,一切正常,但现在我想改变angle_start 180º以在其他页面中显示菜单,因为如果我在其他页面中按下按钮,社交按钮会出现在另一侧。我尝试做出一些改变,但一切都停止工作了,有人能帮我吗?这是我的js代码。
$(document).ready(function() {
//FULL PAGE CODE
$('#fullpage').fullpage({
    verticalCentered: false,

    onLeave: function(index, nextIndex, direction){
        //leaving 1st section
        if(index == 1){
            $('.barra').addClass('fixed');
        }
        //back to the 1st section
        if(nextIndex == 1){
            $('.barra').removeClass('fixed');
            pag = 'nextIndex';
        }
    },

    afterResize: function(){
        windowsHeight = $(window).height();
    }
});
//END FULL PAGE CODE

//WCircleMenu config
$(document).ready(function(){
    $('#my-menu').WCircleMenu({
        angle_start : -Math.PI/1.371,
        delay: 50,
        distance: 100,
        angle_interval: Math.PI/6.5,
        easingFuncShow:"easeOutBack",
        easingFuncHide:"easeInBack",
        step:15,
        openCallback:true,
        closeCallback:true,
        itemRotation:360,
        iconRotation:180,
    });
});
//End WCircleMenu config});

你的小提琴没有正常工作。 - Alvaro
抱歉,我重新上传了外部文件。为了更好地查看结果,您需要在jssfiddle中选择“移动调试”选项。 - hevercking
1个回答

2
您可以在全页面函数中更改参数。
$(document).ready(function() {
            $('#fullpage').fullpage({
                verticalCentered: false,

                onLeave: function(index, nextIndex, direction){
                    //leaving 1st section
                    if(index == 1){
                       $('.barra').addClass('fixed');
                        $('#my-menu').WCircleMenu({angle_start : Math.PI/4.371});
                    }
                    //back to the 1st section
                    if(nextIndex == 1){
                        $('.barra').removeClass('fixed');
                        pag = 'nextIndex';
                        $('#my-menu').WCircleMenu({angle_start : -Math.PI/1.371});
                    }
                },

                afterResize: function(){
                    windowsHeight = $(window).height();
                }

                //to avoid problems with css3 transforms and fixed elements in Chrome, as detailed here: https://github.com/alvarotrigo/fullPage.js/issues/208
                //css3:false
            });


        });

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接