简体   繁体   English

fullpage.js-在工具提示中添加链接

[英]fullpage.js - adding links within tooltips

PROBLEM 问题

I've tried adding a link to the navigational tooltips and, based on html, it should be working. 我尝试将链接添加到导航工具提示,并且基于html,它应该可以正常工作。 However, no matter which tooltip I click, I am taken to the second section - even though the address indicated is correct and should be taking me across all sections. 但是,无论我单击哪个工具提示,我都会转到第二部分-即使所示的地址正确无误,也应该使我进入所有部分。

for (var i = 0; i < $(SECTION_SEL).length; i++) {
            var link = '';
            if (options.anchors.length) {
                link = options.anchors[i];
            }

            var li = '<li><a href="#' + link + '"><span></span></a>';

            // Only add tooltip if needed (defined by user)
            var tooltip = options.navigationTooltips[i];

            if (typeof tooltip !== 'undefined' && tooltip !== '') {
                li += '<div class="' + SECTION_NAV_TOOLTIP + ' ' + options.navigationPosition + '">' + '<a href="#' + link + '">' + tooltip + '</a></div>';
            }

            li += '</li>';

            nav.find('ul').append(li);
        }

I've tried putting the links into the init file as well, but that has the exact same effect. 我也尝试将链接放入init文件中,但是效果完全一样。

Fullpage.js will ignore your link. Fullpage.js将忽略您的链接。 See line 1694 参见第1694行

    function sectionBulletHandler(e){
        e.preventDefault();
        var index = $(this).parent().index();
        scrollPage($(SECTION_SEL).eq(index));
    }

And line 567 : 第567行

.on('click touchstart', SECTION_NAV_SEL + ' a', sectionBulletHandler)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM