Skip to content
This repository was archived by the owner on May 6, 2026. It is now read-only.
This repository was archived by the owner on May 6, 2026. It is now read-only.

Data-generated widgets fail to recognize passed in IDs #5

Description

@sjwilliams

_prepItem generates a domID, even if you pass in an id via the content array

$('#container').ScrollStory({
    content: [{hed:'Headline1', id:'myid1'}, {hed, 'Headline2', id: 'myid2'}]
});

_prepItem should probably be something like this:

// use exisiting ID or generate a new one
if ($el.attr('id')) {
    id = $el.attr('id');
} else {
    if (data.id){
        id = data.id;
    } else {
        id = 'scrollStory_story_' + index;
    }

    $el.attr('id', id);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions