Skip to content

Document load order requirements (when anchors.add() should be called) #69

Closed
@k-funk

Description

@k-funk

Took me a while to figure out the usage, but in my webpack-built application, I included anchor-js like this:

import anchorJS from 'anchor-js';

/* view wrapper */

    var anchors = new anchorJS();
    anchors.options.placement = 'left';
    anchors.add('article h2, article h4');

    // OR

    var anchors = new anchorJS({placement: 'left'}).add('article h2, article h4');

/* end view wrapper */

I think it would be helpful to add this example to the README, or if it's incorrect, an example of how you think it should be used correctly.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions