Skip to content

Feature request - Set offset on a per link basis #11

@danimalweb

Description

@danimalweb

I have a use case where I am using the global selector, e.g. .js-hashy-link and depending on the link I'd like to have different offset values.

I could use scrollToHash, but then I'd have to write a bunch of extra JS code.

How about being able to set the offset via a data attribute?

<a href="#foo" class="js-hashy-link" data-hashy-offset="100">Thing</a>

Pixel values and percentages would be ideal.

Thoughts? Is there a better way?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions