Twitter Boostrap Modal窗口-draggable无法正常工作

时间:2022-04-20 10:53:02

I have the links below that open modal windows, I want to make the modal window draggable. For some reason my modal window draggable script is not working.

我有下面的链接打开模态窗口,我想让模态窗口可拖动。由于某种原因,我的模态窗口可拖动脚本无法正常工作。

here is modal window code and javascript and fiddle link below

这里是模态窗口代码和下面的javascript和小提琴链接

MY FIDDLE

Modal

<div class="modal fade video2 advSearchModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="exampleModalLabel">Video 2</h4>
      </div>
      <div class="modal-body">

        <div class="row">
          <div class="bs-example" data-example-id="responsive-embed-16by9-iframe-youtube">
            <div class="embed-responsive embed-responsive-16by9">

              <video class="embed-responsive-item" controls src="https://www.youtube.com/embed/zpOULjyy-n8?rel=0" type="video/mp4"> </video>

            </div>
          </div>

        </div>

      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <!-- <button type="button" class="btn btn-primary">Send message</button> -->
      </div>
    </div>
  </div>
</div>

JS

 $(".advSearchModal").draggable({
      handle: ".modal-header"
  });

1 个解决方案

#1


2  

You are not include jQuery UI in your code. This is required to be included as it is not a standard part of jQuery.

您的代码中不包含jQuery UI。这是必需的,因为它不是jQuery的标准部分。

#1


2  

You are not include jQuery UI in your code. This is required to be included as it is not a standard part of jQuery.

您的代码中不包含jQuery UI。这是必需的,因为它不是jQuery的标准部分。