
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
draggable-polyfill
Advanced tools
🌈a beautify polyfill for html5 native drag!
Remove translucent preview!
Import the library code
<script src="./lib/draggable-polyfill.js"></script>
npm install draggable-polyfill
then these native draggable elements( [draggable=true]
,img
) will becoming beautiful
[allowdrop]
elements will receive drag event data.
<div draggable="true">drag me</div>
<img src="./avator" alt="avator">
<!--dropbox-->
<div allowdrop></div>
you can use HTML Drag and Drop API
//draggable
draggable.addEventListener('dragstart',()=>{})
draggable.addEventListener('drag',()=>{})
draggable.addEventListener('dragend',()=>{})
//allowdrop
allowdrop.addEventListener('dragover',()=>{})
allowdrop.addEventListener('dragenter',()=>{})
allowdrop.addEventListener('dragleave',()=>{})
allowdrop.addEventListener('drop',()=>{})
draggable elements will add props dragging
and dropbox will add props over
under dragging, so you can custom style through CSS
<!--your draggable element-->
<div class="dragbox" draggable="true">drag me</div>
<!--your allowdrop element-->
<div class="dropbox" allowdrop></div>
/**custom styles**/
.dragbox[dragging]{
box-shadow: 5px 5px 15px rgba(0, 0, 0, .2);
}
.dropbox[over]{
border-color: red;
}
you can set axis=X|Y
to limit drag direction or press shift
key when dragging.
<div axis="X" draggable="true">drag me</div>
Note:This polyfill works on Chrome and Firefox, not for IE( IE is not supports setDragImage
), it will keep default effect.
MIT
FAQs
🌈 a beautify polyfill for native drag!
We found that draggable-polyfill 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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.