Home > Web Front-end > HTML Tutorial > SVG-based odometer digital motion blur special effects plug-in

SVG-based odometer digital motion blur special effects plug-in

黄舟
Release: 2017-01-18 14:44:38
Original
1664 people have browsed it

Download plug-in

(2)

Brief tutorial

odoo.js is an odometer digital motion blur special effect based on HTML5 SVG plugin. This plug-in is used to simulate the effect of rapid flipping of odometer numbers. It's easy to use and has a motion blur effect when the numbers are flipped, which is very cool.

Usage method

Introduce the odoo.js file into the page.

<script type="text/javascript" src="js/odoo.js"></script>
Copy after login

HTML structure

Use a

as the container of the odometer.

<div class="js-odoo"></div>
Copy after login

CSS Style

You can customize the font and color of the numbers and other attributes.

.js-odoo {
  font-size: 60px;
  font-family: Roboto;
  fill: #fff;
  text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);
}
Copy after login

Initialization plug-in

You can initialize the odoo.js plug-in through the following method.

odoo.default({ el:&#39;.js-odoo&#39;,value:&#39;¥68,123,000&#39; })
Copy after login

You can also modify its default configuration parameters during initialization.

odoo.default({
  el: &#39;.js-odoo&#39;,
  value: &#39;£42,000,000&#39;,
  lineHeight: 1.35,
  letterSpacing: 1,
  animationDelay: 100,
  letterAnimationDelay: 100
});
Copy after login

If you want to cancel the odometer animation, you can call the cancel() method.

const cancel = odoo.default({ el: &#39;.js-odoo&#39;, value: &#39;£42,000,000&#39; });
cancel();
Copy after login

The above is the content of the odometer digital motion blur special effects plug-in based on SVG. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template