Skip to content

Attaching functionality to the modal's trigger #30

@jasonmorehead

Description

@jasonmorehead

I've got a modal where I'm trying to get information and/or manipulate the modal's trigger (like add a class to it). In the modal's JS, I have a line that looks like this:

hash.w.addClass('foo');

This line attaches the "foo" class to the modal element when the modal is triggered.

Based on this, I thought I could do something similar to add the "foo" class to the triggering element, like so:

hash.t.addClass('foo');

However, this generates the following error:

Uncaught TypeError: hash.t.addClass is not a function

Is there a way to manipulate the modal's trigger, or perform other jQuery functions on it, like get the value of any "data" attributes that it might have?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions