简体   繁体   中英

Simple JQuery Drag and Drop not working

Okay, so I tried to make this 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 . 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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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