Code

Draggable Elements

Make your site dynamic by adding draggable elements on your Webflow site with this simple Javascript code snippet.

Draggable Elements preview

Make your site dynamic by adding draggable elements on your Webflow site with this simple Javascript code snippet.

How to add it

  1. Add the Javascript code snippet to the closing body custom code section.
  2. Update the class name to the element you want to make draggable

The code

Javascript
                      <!-- Add to body close section -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.3/jquery.ui.touch-punch.min.js"></script>
<script>
$( ".your-draggable-class" ).draggable();
</script>

                    

Browse similar code snippets

Categories

Language

More from Timothy Ricks

Profile →

Similar code snippets

All code snippets →