Intro.js的onbeforechange函数,不能到实际行为中必须点击才能看到那部分的步骤

问题描述 投票:0回答:0

我正在使用 intojs,第一步和第二步没问题然后什么时候从第二步转到第三步,我遇到了第三步的问题。对于正常行为,我们必须先单击然后显示第三步部分.实际上,第 3 步是 3 点按钮,当我们点击那个 3 点按钮时,它会显示一些功能,例如注销和我的个人资料。

这个制作部分的类显示 “下拉配置文件_菜单打开” 这是代码,如果它没有显示 “下拉配置文件_菜单”

这是我的js代码:

<script type="text/javascript">
    $(document).ready(function () {
        var intro = introJs();
        intro.setOptions({
            steps: [
                {
                    element: '#divSideBar',
                    intro: '<strong>Fixing Sidebar</strong> <br/> This is the side bar of the system',
                },
                {
                    element: '#divTopBar',
                    intro: '<strong>Shortcut</strong> <br/>1. Dashboard<br/>2. Profile Search<br/>3. Inbox<br/>4. Org Chart<br/>5. Report',
                    onbeforechange: function () {
                        console.log('Opening dropdown menu');
                        $('#liUserNav').click(); // replace #profile-menu-button with the ID of the button that opens the dropdown menu
                        setTimeout(function () {
                            intro.nextStep();
                        }, 1000); // wait for 1 second for the dropdown menu to appear
                    },
                    onshow: function () {
                        $('.dropdown.profile_menu').addClass('open');
                    }
                },
                {
                    element: '#divProfile',
                    intro: '<strong>Profile</strong> <br/>Your Profile',
                    onshow: function () {
                        $('.dropdown.profile_menu').addClass('open');
                    }
                }
            ]
        });
        introJs().setOption('showBullets', false).setOptions({ scrollToElement: false }).start();
    });
</script>
javascript dropdown onchange intro.js
© www.soinside.com 2019 - 2024. All rights reserved.