Tạo hiệu ứng ripple material khi click đẹp và đơn giản cho Blogspot
04:41 #CSS #Javascript #Thủ Thuật Blogspot
Trong bài viết này mình sẽ hướng dẫn các bạn mang hiệu ứng đó lên tất cả các template khác.
Các bước thực hiện
Thêm CSS vào trước]]></b:skin>.flat-icon-button {
background: transparent;
border: 0;
outline: none;
padding: 8px;
cursor: pointer;
box-sizing: content-box;
display: inline-block;
line-height: 0
}
.flat-icon-button,
.flat-icon-button .splash-wrapper {
border-radius: 50%
}
.flat-icon-button .splash.animate {
-webkit-animation-duration: 0.3s;
animation-duration: 0.3s
}
.flat-button {
cursor: pointer;
border-radius: 2px;
padding: 8px
}
.ripple {
position: relative
}
.ripple>* {
z-index: 1
}
.splash-wrapper {
bottom: 0;
left: 0;
overflow: hidden;
pointer-events: none;
position: absolute;
right: 0;
top: 0;
z-index: 0
}
.splash {
background: rgba(0, 0, 0, .3);
border-radius: 100%;
display: block;
opacity: .9;
position: absolute;
-webkit-transform: scale(0);
-ms-transform: scale(0);
transform: scale(0)
}
.splash.animate {
-webkit-animation: ripple-effect .5s linear;
animation: ripple-effect .5s linear
}
@-webkit-keyframes ripple-effect {
100% {
opacity: 0;
-webkit-transform: scale(2.5);
transform: scale(2.5)
}
}
@keyframes ripple-effect {
100% {
opacity: 0;
-webkit-transform: scale(2.5);
transform: scale(2.5)
}
}Thêm script này vào trước </body><b:template-script async='true' name='indie' version='1.0.0'/>
Cách sử dụng
Hiệu ứng vuông: thêm classripple vào bất cứ element nào.Hiệu ứng tròn: thêm class
ripple flat-icon-button vào bất cứ element nào.





























1 like cho Bác Sĩ =))
Trả lờiXóap.s: Cướp cmt 1 =))
Cảm ơn bạn.
XóaCách sử dụng em đọc kĩ nhưng chưa hiểu lắm anh ạ
Trả lờiXóaVí dụ: <a class='ripple' href='//bacsiwindows.com'>Text</a>
Xóacảm ơn anh ><
Xóahay đấy a
Trả lờiXóa