This time I will share jQuery Plugin and tutorial about Stylish Button Hover Effect With jQuery And CSS3, hope it will help you in programming stack.
A stylish button hover effect that animates the button text character by character on hover by using jQuery and CSS3 transitions & transforms.
See It In Action:
How to use it:
1. Create a button on the page.
1 |
< a href = "" class = "button" > |
2. The necessary CSS styles for the button & hover effect.
002 |
-- background : #275efe ; |
007 |
--shadow: 0 2px 8px -1px rgba( 39 , 94 , 254 , 0.32 ); |
008 |
--shadow-hover: 0 4px 20px -2px rgba( 39 , 94 , 254 , 0.5 ); |
009 |
--font-shadow: var(--font-size); |
011 |
font-family : 'Roboto' ; |
013 |
line-height : var(--font-size); |
017 |
text-decoration : none ; |
018 |
font-size : var(--font-size); |
019 |
letter-spacing : . 5px ; |
020 |
background : var(--background); |
022 |
box-shadow: var(--shadow); |
023 |
-webkit-transform: translateY(var(--y)); |
024 |
transform: translateY(var(--y)); |
025 |
transition: box-shadow var(--duration) ease, -webkit-transform var(--duration) ease; |
026 |
transition: transform var(--duration) ease, box-shadow var(--duration) ease; |
027 |
transition: transform var(--duration) ease, box-shadow var(--duration) ease, -webkit-transform var(--duration) ease; |
033 |
text-shadow : 0 var(--font-shadow) 0 var(--text); |
038 |
-webkit-backface- visibility : hidden ; |
039 |
backface- visibility : hidden ; |
041 |
transition: -webkit-transform var(--duration) ease; |
042 |
transition: transform var(--duration) ease; |
043 |
transition: transform var(--duration) ease, -webkit-transform var(--duration) ease; |
044 |
-webkit-transform: translateY(var(--m)); |
045 |
transform: translateY(var(--m)); |
048 |
.button span i:nth-child( 1 ) { |
049 |
transition-delay: 0.05 s; |
052 |
.button span i:nth-child( 2 ) { |
053 |
transition-delay: 0.1 s; |
056 |
.button span i:nth-child( 3 ) { |
057 |
transition-delay: 0.15 s; |
060 |
.button span i:nth-child( 4 ) { |
061 |
transition-delay: 0.2 s; |
064 |
.button span i:nth-child( 5 ) { |
065 |
transition-delay: 0.25 s; |
068 |
.button span i:nth-child( 6 ) { |
069 |
transition-delay: 0.3 s; |
072 |
.button span i:nth-child( 7 ) { |
073 |
transition-delay: 0.35 s; |
076 |
.button span i:nth-child( 8 ) { |
077 |
transition-delay: 0.4 s; |
080 |
.button span i:nth-child( 9 ) { |
081 |
transition-delay: 0.45 s; |
084 |
.button span i:nth-child( 10 ) { |
085 |
transition-delay: 0.5 s; |
088 |
.button span i:nth-child( 11 ) { |
089 |
transition-delay: 0.55 s; |
093 |
--y: var(--move-hover); |
094 |
--shadow: var(--shadow-hover); |
098 |
--m: calc(var(--font-size) * -1 ); |
102 |
--font-shadow: calc(var(--font-size) * -1 ); |
105 |
.button.reverse:hover i { |
106 |
--m: calc(var(--font-size)); |
3. Load the necessary jQuery JavaScript library in the document.
1 |
< script src = "/path/to/jquery.min.js" ></ script > |
4. The jQuery script to enable the button hover effect.