Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
draggablejs
Advanced tools
Make javascript object become draggable and control another object with it.
Install directly from npm using command-line.
npm install --save draggablejs
Or clone from github
First, prepare HTML and CSS documents, make sure you pay attention to data-draggable-target
attribute.
<div class="container" >
<div class="windows" id="windows-1" >
<div class="windows-top-bar" id="windows-draggable-1" data-draggable-target="windows-1" >
Window
</div>
<div class="windows-content" >
<!-- You windows content here -->
</div>
</div>
<div class="windows" id="windows-2" >
<div class="windows-top-bar" id="windows-draggable-2" data-draggable-target="windows-2" >
Window
</div>
<div class="windows-content" >
<!-- You windows content here -->
</div>
</div>
</div>
.container {
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
}
.windows {
width: 300px;
position: absolute;
}
.windows-top-bar {
cursor: move;
width: 100%;
height: 20px;
}
.windows-content {
width: 100%;
height: 300px;
}
And then you only have to initialize the object
var Draggable = require('draggable');
...
Draggable.init("windows-draggable-1", {
onDragStart: function() {
console.log("onDragStart");
},
onDrag: function() {
console.log("onDrag");
},
onDrop: function() {
console.log("onDrop");
}
});
FAQs
Simple draggable object for javascript
We found that draggablejs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.