Skip to content

Navigation Widths not sizing properly in JS #8

Description

@mscottfowler

Since the script is finding just 'li" in the document, and I have other 'li's' in my content, the script is reading all of the 'li' elements and sizing accordingly, leaving my navigation hover severely smaller than it should be. I tried putting a class on the li's for the navigation in order to separate this li from the others I have in the content, but it's not working. Any suggestions?

IRT:
onInit: function(tab, navigation, index) {

        //check number of tabs and fill the entire row
        var $total = navigation.find('li').length;
        $width = 100 / $total;
        var $wizard = navigation.closest('.wizard-card');

        $display_width = $(document).width();

        if ($display_width < 600 && $total > 3) {
            $width = 50;
        }

        navigation.find('li').css('width', $width + '%');
        $first_li = navigation.find('li:first-child a').html();
        $moving_div = $('<div class="moving-tab">' + $first_li + '</div>');
        $('.wizard-card .wizard-navigation').append($moving_div);
        refreshAnimation($wizard, index);
        $('.moving-tab').css('transition', 'transform 0s');
    },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions