简体   繁体   English

简单的JQuery拖放无法正常工作

[英]Simple JQuery Drag and Drop not working

Okay, so I tried to make this jsFiddle 好的,所以我尝试制作这个jsFiddle

But when I go to the website where I am trying to make this , I can't drag it. 但是,当我去的网站,我想使这个 ,我不能拖。

How come I can't drag or close this popup I made? 为什么我不能拖动或关闭我创建的此弹出窗口?

In JSFiddle you're using jQuery v 1.7.2 , on your website v 1.3 - that's ancient . 在的jsfiddle你使用jQuery v 1.7.2 ,在您的网站v 1.3 -这是古老的 Just upgrade to the latest 只需升级到最新版本

To update put this in your file instead of the old references: 要进行更新,请将其放在文件中,而不是旧的引用中:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js"></script>
<script>
    $( "#myDialog" ).draggable({
        handle: "#title"
    });
    $( "#closeBtn" ).click(function(){
        $(this).parent().fadeOut();
    });
</script>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM