Home  >  Article  >  Web Front-end  >  Use Sticker.js to achieve sticker effect_javascript skills

Use Sticker.js to achieve sticker effect_javascript skills

WBOY
WBOYOriginal
2016-05-16 16:17:241676browse

Sticker.js is a small JavaScript library that allows you to create beautiful sticker effects on web pages. No dependencies (no jQuery required) and works in most major browsers that support CSS3. There are simple usage examples below, and more functions are waiting for you to discover.

Usage example:

HTML:

Copy code The code is as follows:




CSS:

Copy code The code is as follows:

.sticker {
width: 180px;
height: 180px;
}
// add image
.example-1 .sticker-img {
background-image: url(heroes-2.png);
}
// add color
.example-2 .sticker-img {
background-color: #ff4a85;
}
// change shadow opacity
.example-2 .sticker-shadow {
opacity: 0.6;
}

JavaScript:

Copy code The code is as follows:


Sticker.init('.sticker');

 Download now Online demo

Statement:
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