Git Product home page Git Product logo

better-draggable-ball's Introduction

better-draggable-ball

这是一款使用纯TYPESCRIPT开发的可拖拽悬浮球,这意味着它不需要安装其他依赖即可直接导入到你的开发项目当中使用

最简单的使用方法

第一步,您需要在您的项目中安装它,执行以下命令

npm install better-draggable-ball --save

在您的项目中导入BetterGraggbleBall

import BDrag from 'better-draggable-ball';

创建一个div,并给他设置一个ID值和样式

<div class="root">
    <div class="BDrag"></div>
</div>
.drag{
    width: 50px;
    height: 50px;
    background-color: rgb(238, 238, 238);
    border-radius: 50%;
    border: 5px solid rgb(170, 170, 170);
}

BetterGraggbleBall提供了一个类,实例化的第一个参数是一个原生DOM元素

const BDragDom = document.getElementById('BDrag')
const BDrag = new BDrag(BDragDom)

better-draggable-ball's People

Contributors

qc2168 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.