Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

movable-resizable-js

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

movable-resizable-js

This project is a javascript library to facilitate movable and resizable interaction on web page. The library is provided by Tencent Real-timing Communication(TRTC) team.

  • 0.1.0
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-96.32%
Maintainers
0
Weekly downloads
 
Created
Source

movable-resizable-js

This project is a javascript library to facilitate movable and resizable interaction on web page. The library is provided by Tencent Real-timing Communication(TRTC) team.

Installation

#npm
npm install movable-resizable-js

#yarn
yarn add movable-resizable-js

Usage

import { Movable, Resizable } from 'movable-resizable-js';

const targetElement = document.getElementById('movable-and-resiable');
const targetContainer = document.body;

// Enable moving
const movableController = new Movable(
    targetElement,
    targetContainer,
    {
        canExceedContainer: true, // default `false`
    }
);
movableController.on('move', (left, top) => {
    console.log('element moved to:', left, top);
});

// Enable Resizing
const resizableController = new Resizable(
    targetElement,
    targetContainer,
    {
        canExceedContainer: true, // default `false`
        keepRatio: true, // default `false`
        stopPropagation: true // default `false`. To use with `Movable` together, this option must be `true`, or else will trigger moving action too.
    }
);
resizableController.on('resize', (left, top, width, height) => {
    console.log('element resized to:', left, top, width, height);
});

Keywords

FAQs

Package last updated on 21 Nov 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc