We first need to get the JQuery libraries.
JQuery
Copy and paste this:
<script src="https://code.jquery.com/jquery-1.12.4.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
For our actual JQuery code, we have:
$(function(){ $( "element" ).draggable(); });
The dragging works for:
id
class
The name of an element's id goes before an # symbol, like this:
#
$(function(){ $( "#id_name_of_element" ).draggable(); });
The name of an element's class goes before an . symbol, like this:
.
$(function(){ $( "class_name_of_element" ).draggable(); });
inputs
textareas
div
Anyways...
The Tutorial Is Done.
Does it work on mobile?
How 2 Make A Draggable HTML Element!
How 2 Make A Draggable Element! (HTML)
Step 1
We first need to get the
JQuery
libraries.Copy and paste this:
Credits Go To code.jquery.com For The Libraries!
Step 2
For our actual
JQuery
code, we have:The dragging works for:
id
attributeclass
attributeUsing Id
The name of an element's id goes before an
#
symbol, like this:Using Class
The name of an element's class goes before an
.
symbol, like this:Downsides
inputs
andtextareas
div
The Tutorial Is Done.
Bye!
Does it work on mobile?