Skip to content

Unstick and Stick two elements #16

@anthonybalmeo

Description

@anthonybalmeo

Do you have any suggestions of sticking and unsticking elements using the events sticky-start and sticky-end

  didInsertElement() {
    Ember.$('.sticky-nav').on('sticky-start', function() {
    Ember.$('.app-header').unstick();
    });

    Ember.$('.sticky-nav').on('sticky-end', function() {
      Ember.$('.app-header').sticky({
        zIndex: 50,
        wrapperClassName: 'app-header-sticky',
      });
    });
  },

I have something like this but when I call unstick consecutively, I get a Cannot read property 'stickyWrapper' of undefined. It still works but there's some step prior that errors out that I'm trying to figure out. Thoughts?

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