Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
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
The npm package draggablejs receives a total of 0 weekly downloads. As such, draggablejs popularity was classified as not popular.
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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.