Minimal Image Panning Library – LC-Mouse-Drag
Supports both mouse drag and touch swipe events.
1. Import the lc-mouse-drag.js JavaScript library into the document.
<script src="lc-mouse-drag.js"></script>
2. Initialize the library on the image container as follows:
<div id="inner"> <img src="demo.webp" /> </div>
lc_mouseDrag('#inner'); 3. Determine the animation delta when ending dragging. Default: 0.3.
lc_mouseDrag('#inner', 0); 4. Disable X-axis and/or Y-axis dragging. Default: false.
lc_mouseDrag('#inner',
0, true, false); 5. Important CSS rules for desktop.
body:not(.lc_mousedrag_is_mobile) #inner {
overflow: hidden;
cursor: grab;
} v1.0.2 (10/31/2025)
The post Minimal Image Panning Library – LC-Mouse-Drag appeared first on CSS Script.
BIG COUNTRY, Texas (KTAB/KRBC) - A brand new Texas State Park is now open, and…
Aether OS puts a full-fledged desktop in your browser that ties directly into the AT…
A new weekend has arrived, and today, you can save big on Trails in the…
data-anim is a JavaScript animation library that applies CSS-powered animations to HTML elements while scrolling/hovering/clicking/loading…
The <i-html> web component allows you to dynamically import HTML content inline, similar to an…
Can’t. Stop. Dancing. | Image: Wonderwheel Recordings Shout out to subscriber N_Gorski for today's pick.…
This website uses cookies.