Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9083207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:43:33+00:00 2026-06-16T20:43:33+00:00

I have this youtube video embedded into a jQuery dialog. The dialog is created

  • 0

I have this youtube video embedded into a jQuery dialog. The dialog is created like so:

$(function() {
    $.prepare_dialog2 = function() {
        $('body').append('<div class="dlgVid"></div>');
        $('.dlgVid').dialog({ autoOpen: false,  modal: true, position: ['center',100], resizable: false, width: 640 });
    }
    $.dlgVid = function(url,ttl) {
        $.ajax({
            type: 'POST', url: url,
            success: function(data) { $('.dlgVid').dialog('open').dialog('option','title',ttl).html(data);},
            error: function() { alert('Oops! An error occured. Please try again or contact us if the problem persists.');}
        });
    }

    $.prepare_dialog2();    
});

and is called using the $.dlgVid function. In the dialog window, there is a close link which upon click closes the dialog like so:

$('.dlgCloser').live('click',function(){
    $('.dlgVid').dialog('close');
});

The problem is when I close the dialog, the video continues to play. I need it to stop. I tried this but it didn’t work (as in the video is still playing, I can hear the audio):

$('.dlgCloser').live('click',function(){
    $('.dlgVid').dialog('destroy');
    $.prepare_dialog2();
});

Does anyone how to stop the playback or why destroy isn’t removing the dialog from the DOM?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T20:43:34+00:00Added an answer on June 16, 2026 at 8:43 pm

    I think this destroy is actually hiding it thus why it’s still playing. Try this:

    $('.dlgCloser').live('click',function(){
        $('.dlgVid').remove();
    });
    

    Although this might fix the problem, this will also remove every instance of .dlgVid

    Also, using the .live() is depracated from the jQuery library. You should use .on().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this preg_match rule that transforms plain youtube link into an actual player
I have this regex patter to grab YouTube video ID's preg_match_all( '/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^&?\/ ]{11})/i', $string,
We have a Wicket app with a page that includes an embedded Youtube video.
I have youtube videos embedded like so: <object height=25 width=610><param name=movie value=http://www.youtube.com/v/GBApIkX0YN4&hl=en_US&color1=0xf4f4f4&color2=0xffffff&hd=0&fs=0&enablejsapi=1&playerapiid=ytplayer> </param> <param
I have a page with a YouTube video embedded in html. I want to
I am attempting to hide a DIV once a embedded Youtube video is finished.
I need to find out when an embedded youtube video ends via javascript. This
I'm using the code from this question to autoplay an iframe embedded Youtube video
I have the following code, necessary to track an embedded Youtube video in my
I have a YouTube video embedded on my site using an iFrame . I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.