npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

lessaber-drag-div

v0.0.2

Published

make Div can be dragged

Downloads

4

Readme

lessaber-drag-div

拖拽div插件 - make Div can be dragged

GitHub

https://github.com/lessaber/lessaber-drag-div

用法 usage

npm install lessaber-drag-div

import drag from 'lessaber-drag-div'

var bar = document.querySelector('#bar') // 拖拽区域 - drop zones 

var target = document.querySelector('#target') //移动的元素 - The moving element 

drag(bar, target, callbackFn = null) 

功能 function

使div可以拖拽 - make Div can be dragged

div会被限制在窗口显示范围内 - The div is limited to the window display

双击bar区域恢复原来位置 - Double-click the bar area to restore the original location

注意 attention

  1. 可以拖拽的区域受到父元素的限制 - The area that can be dragged is restricted by the parent element

  2. callbackFn 鼠标拖拽时触发 - when the mouse is dragging

  3. target 需要设置 position: absolute/reletive; - Target needs to set position: absolute/reletive;

原型来自张鑫旭的博客 地址-address