DirectionAwareHoverEffect
How to create a direction-aware hover effect using CSS3 and jQuery. The idea is to slide in an overlay from the direction we are moving with the mouse.
Install / Use
/learn @codrops/DirectionAwareHoverEffectREADME
DirectionAwareHoverEffect
How to create a direction-aware hover effect using CSS3 and jQuery. The idea is to slide in an overlay from the direction we are moving with the mouse.
How to use
$('#da-thumbs > li').hoverdir();
// or with options
$('#da-thumbs > li').hoverdir({hoverDelay: 75, hoverElem: '.elem'});
Default options
defaults: {
speed: 300, // Times in ms
easing: 'ease',
hoverDelay: 0, // Times in ms
inverse: false,
hoverElem: 'div'
}
Method
show
Show the hover element, after show method is triggered, hover don't show or hide on mouseenter and mouseleave.
You have to use hide method to bind mouseenter and mouseleave.
$('#da-thumbs > li').hoverdir('show'); // Default value top
// or with a specific direction
$('#da-thumbs > li').hoverdir('show','bottom'); // Possible value top, right, bottom, left
hide
Hide the hover element and bind mouseenter and mouseleave.
$('#da-thumbs > li').hoverdir('hide'); // Default value bottom
// or with a specific direction
$('#da-thumbs > li').hoverdir('hide','top'); // Possible value top, right, bottom, left
setOptions
Allows you to change the options while the plugin is already running
$('#da-thumbs > li').hoverdir('setOptions', options);
destroy
Unbind the plugin
$('#da-thumbs > li').hoverdir('destroy');
rebuild
Bind the plugin
$('#da-thumbs > li').hoverdir('rebuild');
// or with options
$('#da-thumbs > li').hoverdir('rebuild', options);
Licensed under the MIT License
Related Skills
node-connect
347.6kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.6kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.6kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
