WIP Panning library. Phase 1 complete
The package can be found here
To see the library in action go here
In depth code documentation here.
- Install with npm:
npm install tsl_pan_library
. - Import to project:
import 'PanLibrary' from 'tsl_pan_library'
. - Use the new keyword to create a pannable object.
- Pass a container and a pannable element to the constructor.
- optional x and y positions.
Example
import PanningLibrary from "./panninglibrary";
window.addEventListener("DOMContentLoaded", () => {
let container = document.querySelector(".container");
let content = document.querySelector(".content");
new PanningLibrary(container, content, -20, -20);
});