Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
M

motio

> 编程语言
Open source

Small JavaScript library for sprite based animations and panning.

749 stars0 likes1 views
WebsiteGitHub

About

Small JavaScript library for sprite based animations and panning.

Motio

Small JavaScript library for simple but powerful sprite based animations and panning.

Motio takes an element and animates its background position to create an animation effect. All is super optimized for speed and chained to the requestAnimationFrame, with a polyfill for older browsers without it.

That being said, animating the element background is not the fastest possible way how to do this (canvas solutions are a lot faster), but it is sure as hell the most simple one, and compatible with everything from IE6 and up.

Dependencies

Motio has no dependencies, but there is an optional Motio jQuery plugin extension available.

Compatibility

Works everywhere.

Usage

Sprite animation mode:

javascript
var element = document.querySelector('#sprite');
var sprite = new Motio(element, {
	fps: 10,
	frames: 14
});
sprite.play();   // start animation
sprite.pause();  // pause animation
sprite.toggle(); // toggle play/pause
sprite.toStart(); // animate to 1st frame and stop
sprite.toEnd();   // animate to last frame and stop
sprite.to(10);    // animate to 11th frame and stop

Seamless background panning mode:

javascript
var element = document.querySelector('#panning');
var panning = new Motio(element, {
	fps: 30, // Frames per second. More fps = higher CPU load.
	speedX: -30 // Negative horizontal speed = panning to left.
});
panning.play();    // start animation
panning.pause();   // pause animation
panning.toggle();  // toggle play/pause

Download

Latest stable release:

  • Production motio.min.js - 3KB, 1.6KB gzipped
  • Development motio.js - 12KB

jQuery plugin version:

  • Production jquery.motio.min.js - 3.7KB, 1.8KB gzipped
  • Development jquery.motio.js - 13.5KB

When isolating issues on jsfiddle, you can use this URL:

  • http://darsain.github.io/motio/js/motio.min.js

Documentation

Can be found in the docs directory.

Contributing

Please, read the Contributing Guidelines for this project.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

JavaScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言