foundation / foundation-sites

The most advanced responsive front-end framework in the world. Quickly create prototypes and production code for sites that work on any kind of device.
https://get.foundation
MIT License
29.64k stars 5.5k forks source link

[Magellan] Update event fires constantly #10384

Closed mattbag closed 6 years ago

mattbag commented 7 years ago

I wasn't able to find a solution online, and I'm not confident in fiddling with this event, but most of all I'm sure with the rebuild solving this issue might be easy enough... I imported in my js triggers,smoothscroll and magellan. It works great, but since I'm attaching a few functions it seems a bit of a waste. Cheers!

How to reproduce this bug:

  1. Step one: any magellan instance
  2. Step two: show the magellan event in console
  3. Step three: ponder a solution

What should happen:

magellan event should fire after the active magellan section as been updated

What happened instead:

the magellan event fires on every scroll motion

Browser(s) and Device(s) tested on:

Chrome

Foundation Version(s) you are using:

6.4.1

Test case link:

https://codepen.io/mattbag/pen/LLXJVP?editors=1111

Older version possibile solution

https://github.com/zurb/foundation-sites/issues/9068

kball commented 6 years ago

@IamManchanda can you take a look at this one as part of your entre into the JS world?

IamManchanda commented 6 years ago

Will look into it ... cool!

mattbag commented 6 years ago

I don't know if it relates at all, while studying vanilla js I came up with this solution https://codepen.io/mattbag/pen/WZvoPo?editors=0101

Basically gets the index of the section to check the trigger. Hope it helps somehow. Thanks!