Jump to content

Target ID of a bootstrap modal to stop video from playing when modal is closed


Recommended Posts

Hi guys,


I have a video into a bootstrap modal form that is opened on click. Now when i close the modal i want that video to stop playing.

I've manage to do some javascript to do that but instead of stopping the the video i want it stops all the video from that page. 


How can i target in the script below only the ID of the modal that i want to be stoped from playing?

$('body').on('hidden.bs.modal', '.modal', function () {
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.