Draggable Elements
Make your site dynamic by adding draggable elements on your Webflow site with this simple Javascript code snippet.
Make your site dynamic by adding draggable elements on your Webflow site with this simple Javascript code snippet.
How to add it
- Add the Javascript code snippet to the closing body custom code section.
- 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>