mec
mec

Reputation: 77

Foundation Magellan starts sticking too early or too late after browser is resized

Mainly my issue is that Magellan starts sticking too early or too late after scaling the browser window. At first load everything works before resize and also when resized after page is refreshed.

When downscaling browser window the automatic treshold is still using the "initial" calculated treshold from the larger viewport that was first loaded. I've tried creating an event binding to window.resize and then setting the treshold again to 0 and calling reflow and set_expedition_position, it makes it slightly better but doesnt fix the issue.

Specifying a value for treshold has no significant effect.

My settings:

$(document).foundation({
    "magellan-expedition": {
        active_class: 'active',
        threshold: 0,
        destination_threshold: 0,
        throttle_delay: 50,
        fixed_top: 70,
        offset_by_height: true
    }
});

Image of too early sticking

Image of too early sticking magellan after resize, the bar above is the one that should be sticking only after the bar below.

Upvotes: 1

Views: 146

Answers (1)

mec
mec

Reputation: 77

This wasn't actually just a bug with magento but instead was the cause of multiple different issues. I'm unable to reproduce this anymore.

Upvotes: 0

Related Questions