mgGlitch.js 介绍
mgGlitch.js是一款能够模拟 显示 器故障 效果 的jQuery 插件 。mgGlitch.js能够为 页面 中的任何元素制作错屏 效果 ,就像 显示 器发生故障时的画面在闪动的 效果 。
mgGlitch.js使用
1、引入
<script src="path/to/jquery.min.js"></script>
<script src="path/to/mgGlitch.js"></script>
2、html
<div class="container">
<div class="glitch-img" background-image: url('img/1.jpg"></div>
</div>
3、初始化
$( function() {
$( ".glitch-img" ).mgGlitch({
destroy : false,// set 'true' to stop the plugin
glitch: true,// set 'false' to stop glitching
scale: true,// set 'false' to stop scaling
blend : true,// set 'false' to stop glitch blending
blendModeType : 'hue',// select blend mode type
glitch1TimeMin : 600,// set min time for glitch 1 elem
glitch1TimeMax : 900,// set max time for glitch 1 elem
glitch2TimeMin : 10,// set min time for glitch 2 elem
glitch2TimeMax : 115,// set max time for glitch 2 elem
zIndexStart : 8,// because of absolute position,set z-index base value
});
});
网站地址 : https://codepen.io/hmongouachon/pen/LZGwWY
GitHub: https://github.com/hmongouachon/mgGlitch
网站描述: 一款能够模拟 显示 器故障 效果 的jQuery 插件
mgGlitch.js官方网站
官方网站: https://codepen.io/hmongouachon/pen/LZGwWY
如果觉得 网站内容还不错,欢迎将 网站 推荐给程序员好友。