【发布时间】:2018-07-04 15:55:52
【问题描述】:
我在使用 jquery 鼠标悬停时遇到了一些困难。
我只想在鼠标悬停在图像上时发生失真效果,而不是在鼠标离开时发生。我使用 mgGlitch 来实现效果,并使用 jquery 来实现悬停。感谢您的帮助!
JQUERY
$(".glitch-img").hover(function() {
$( ".glitch-img" ).mgGlitch({
// set 'true' to stop the plugin
destroy : false,
// set 'false' to stop glitching
glitch: true,
// set 'false' to stop scaling
scale: true,
// set 'false' to stop glitch blending
blend : true,
// select blend mode type
blendModeType : 'hue',
// set min time for glitch 1 elem
glitch1TimeMin : 200,
// set max time for glitch 1 elem
glitch1TimeMax : 400,
// set min time for glitch 2 elem
glitch2TimeMin : 10,
// set max time for glitch 2 elem
glitch2TimeMax : 100,
}),
// .mouseout(function() {
// $(".glitch-img").myGlitch({
// // set 'true' to stop the plugin
// destroy : false,
// // set 'false' to stop glitching
// glitch: false,
// // set 'false' to stop scaling
// scale: false,
// // set 'false' to stop glitch blending
// blend : false,
// })
});
【问题讨论】:
标签: javascript jquery html hover