Jquery drag and drop

In this tutorial you will learn how to create Drag and Drop in JQuery. 

 

Draggable

Enable draggable functionality on any DOM element. Move the draggable object by clicking on it with the mouse and dragging it anywhere within the viewport.

 

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>jQuery UI Draggable - Default functionality</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
  <script src="//code.jquery.com/jquery-1.9.1.js"></script>
  <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css">
  <style>
  #draggable { width: 150px; height: 150px; padding: 0.5em; }
  </style>
  <script>
  $(function() {
    $( "#draggable" ).draggable();
  });
  </script>
</head>
<body>
 
<div id="draggable" class="ui-widget-content">
 <p>Drag me around</p>
</div>

 
</body>
</html>

 

Droppable

Enable any DOM element to be droppable, a target for draggable elements.

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>jQuery UI Droppable - Default functionality</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
  <script src="//code.jquery.com/jquery-1.9.1.js"></script>
  <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css">
  <style>
  #draggable { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 10px 10px 10px 0; }
  #droppable { width: 150px; height: 150px; padding: 0.5em; float: left; margin: 10px; }
  </style>
  <script>
  $(function() {
    $( "#draggable" ).draggable();
    $( "#droppable" ).droppable({
      drop: function( event, ui ) {
        $( this )
          .addClass( "ui-state-highlight" )
          .find( "p" )
            .html( "Dropped!" );
      }
    });
  });
  </script>
</head>
<body>
 
<div id="draggable" class="ui-widget-content">
  <p>Drag me to my target</p>
</div>
 
<div id="droppable" class="ui-widget-header">
  <p>Drop here</p>
</div>
 
 
</body>
</html>
Recent Topics
Subject
Post Reply
Open
Recent
介绍 模块 MooZiiCart Search 用关键词帮产品搜索按照设置。
By alfie8522 Wed 08 Jun 2022 12:56 pm Board Chinese Language - 简体中文
0
1345
Wed 08 Jun 2022 12:56 pm By alfie8522 View Topic 介绍 模块 MooZiiCart Search 用关键词帮产品搜索按照设置。
介绍 Plugin Search MDFiles 搜索产品信息通过 com_search。
By alfie8522 Mon 06 Jun 2022 1:23 pm Board Chinese Language - 简体中文
2
424
Tue 07 Jun 2022 11:57 am By alfie8522 View Topic 介绍 Plugin Search MDFiles  搜索产品信息通过 com_search。
Whats the best sidebar menu extension/module for J4 ?
By mati123 Sat 04 Jun 2022 8:11 pm Board English Language
0
631
Sat 04 Jun 2022 8:11 pm By mati123 View Topic Whats the best sidebar menu extension/module for J4 ?
介绍 Plugin System MRestore 对于想要恢复系统的网站 ,为了恢复其他信息。
By alfie8522 Sat 04 Jun 2022 1:13 pm Board Chinese Language - 简体中文
0
484
Sat 04 Jun 2022 1:13 pm By alfie8522 View Topic 介绍 Plugin System MRestore 对于想要恢复系统的网站 ,为了恢复其他信息。
Joomla Error - php_network_getaddresses: getaddrinfo failed
By Skyzhay Mon 16 May 2022 3:13 pm Board English Language
1
1447
Mon 16 May 2022 4:26 pm By mindphp View Topic Joomla Error - php_network_getaddresses: getaddrinfo failed
upgrade Joomla 3.10.8 to Joomla 4.1 Database Problems
By ghdfkjg Wed 11 May 2022 3:29 pm Board English Language
0
976
Wed 11 May 2022 3:29 pm By ghdfkjg View Topic upgrade Joomla 3.10.8 to Joomla 4.1 Database Problems
New Joomla Installation of 4.1 Results in 500 Error
By ghdfkjg Wed 11 May 2022 3:00 pm Board English Language
0
1203
Wed 11 May 2022 3:00 pm By ghdfkjg View Topic New Joomla Installation of 4.1 Results in 500 Error
Learn how to create a gmail account
By tomcopper987 Tue 10 May 2022 5:17 pm Board English Language
1
1765
Wed 08 Feb 2023 11:50 pm By Anonymous View Topic Learn how to create a gmail account
显示网上商店的统计,通过MooZiiCart 的 模块 Statistics 。
By alfie8522 Tue 10 May 2022 1:22 pm Board Chinese Language - 简体中文
0
505
Tue 10 May 2022 1:22 pm By alfie8522 View Topic 显示网上商店的统计,通过MooZiiCart 的 模块 Statistics 。
介绍 plg system mzc fulfillment - 添加 mooziicart 的 fulfillment系统。
By alfie8522 Mon 09 May 2022 3:15 pm Board Chinese Language - 简体中文
0
448
Mon 09 May 2022 3:15 pm By alfie8522 View Topic 介绍 plg system mzc fulfillment - 添加 mooziicart 的 fulfillment系统。
介绍 com_mdmzcbridgeerp 对于Mooziicart 和 ERP 之间,数据连接。
By alfie8522 Tue 03 May 2022 4:46 pm Board Chinese Language - 简体中文
0
561
Tue 03 May 2022 4:46 pm By alfie8522 View Topic 介绍 com_mdmzcbridgeerp 对于Mooziicart 和 ERP 之间,数据连接。
介绍插件 MZC reCaptcha 对于增加MooZiiCart 1.0.0的 reCaptcha以各种形式。
By alfie8522 Sat 30 Apr 2022 12:53 pm Board Chinese Language - 简体中文
0
414
Sat 30 Apr 2022 12:53 pm By alfie8522 View Topic 介绍插件 MZC reCaptcha 对于增加MooZiiCart 1.0.0的 reCaptcha以各种形式。
介绍 QuickStart MooZiiCart- MegaDeal 是一个帮助安装MooZiiCart套餐 Joomla + MooZiiCart 通过 Template MegaDeal 1.0.12
By alfie8522 Fri 29 Apr 2022 2:27 pm Board Chinese Language - 简体中文
0
852
Fri 29 Apr 2022 2:27 pm By alfie8522 View Topic 介绍 QuickStart MooZiiCart- MegaDeal 是一个帮助安装MooZiiCart套餐 Joomla + MooZiiCart 通过 Template MegaDeal 1.0.12
What ecommerce module for free in joomla
By azael123 Thu 28 Apr 2022 8:03 pm Board English Language
1
912
Fri 06 May 2022 10:30 am By pyspt012 View Topic What ecommerce module for free in joomla
介绍QuickStart MooZiiCart- Protostar 是一个帮助安装MooZiiCart套餐 Joomla + MooZiiCart 通过 Template Protostar 1.0.9
By alfie8522 Thu 28 Apr 2022 12:20 pm Board Chinese Language - 简体中文
0
633
Thu 28 Apr 2022 12:20 pm By alfie8522 View Topic 介绍QuickStart MooZiiCart- Protostar 是一个帮助安装MooZiiCart套餐  Joomla + MooZiiCart 通过 Template Protostar 1.0.9
介绍QuickStart MooZiiCart - Herix 是一个帮助安装MooZiiCart套餐 Joomla + MooZiiCart 通过 Template Herix 1.0.10
By alfie8522 Wed 27 Apr 2022 5:39 pm Board Chinese Language - 简体中文
0
582
Wed 27 Apr 2022 5:39 pm By alfie8522 View Topic 介绍QuickStart MooZiiCart - Herix 是一个帮助安装MooZiiCart套餐 Joomla + MooZiiCart 通过 Template Herix 1.0.10
介绍了模板 MooZii Opencart - Template MooZiicart ,自己建一个漂亮的网站。
By alfie8522 Tue 26 Apr 2022 1:33 pm Board Chinese Language - 简体中文
0
814
Tue 26 Apr 2022 1:33 pm By alfie8522 View Topic 介绍了模板 MooZii Opencart  - Template MooZiicart ,自己建一个漂亮的网站。
介绍 Plugin System MZC bridgeorders 1.0.1 - 同步信息发送订单去 ERP ,在站点上订购时 。
By alfie8522 Mon 25 Apr 2022 4:30 pm Board Chinese Language - 简体中文
0
443
Mon 25 Apr 2022 4:30 pm By alfie8522 View Topic 介绍 Plugin System MZC bridgeorders 1.0.1 - 同步信息发送订单去 ERP ,在站点上订购时 。
Introducing Plugin MooZiiCart Search - add search result to com_search for product information
By pyspt012 Sat 23 Apr 2022 4:03 pm Board English Language
0
2375
Sat 23 Apr 2022 4:03 pm By pyspt012 View Topic Introducing Plugin MooZiiCart Search - add search result to com_search for product information
Introducing Module MooZiiCart Recent Comment - displays the latest comment
By pyspt012 Sat 23 Apr 2022 3:52 pm Board English Language
0
801
Sat 23 Apr 2022 3:52 pm By pyspt012 View Topic Introducing Module MooZiiCart Recent Comment - displays the latest comment