Give example of using modalEvent.relatedTarget to pass data from trigger element
Created by: cvrebert
I've seen a number of questions like this one: http://stackoverflow.com/q/24951453/3342739
Seems that some folks aren't making the connection that you can pass data from a trigger element to a modal initializer event callback by making use of event.relatedTarget
and attributes (often data-*
) on the trigger element, and thus adjust the modal's contents depending on which trigger button was clicked.