swingdrag.js---a jQuery UI plugin, which adds a nice swing effect to the jQuery UI drag function


GitHub here

swingdrag is a jQuery UI plugin, which adds a nice swing effect to the jQuery UI drag function.


Step1:
link the swingdrag.css file
<link rel="stylesheet" type="text/css" href="css/swingdrag.css">
link the jquery , jquery-ui and swingdrag.min.js

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script type="text/javascript" src="js/jquery.ui.swingdrag.min.js"></script>
Step2:
html

Wrap the content in the div named container.

css

Basic styling sheet.

swingdrag.css
Swingdrag.css is for adding shadow.


Step3:
JS Usage
js

$("#element").swingdrag({
  // The angle of rotation in degree. default is 8
  rotationAngleDeg: 10,
  // Indicates whether a pickup-/drop shadow should be shown.
  showShadow: true,
  // The pick up scale factor indicates the size change during dragging.
  pickUpScaleFactor: 1.2
});





Popular posts from this blog

Fancyapps — easily build overlay windows with carousel

Meet Tippy.js: The Complete Tooltip Popover Plugin

Meet Mantine: A TS-Based Open-Source React Components Library