Tagged: :hover, css, transition
- This topic has 2 replies, 2 voices, and was last updated 6 years, 2 months ago by
majorpayne.
Author | Posts |
---|---|
majorpayne
February 7, 2019 at 6:43 pm
|
Heads up! this post was created when Microthemer was at version 5. The current version is 7. Some references to the interface may be out of date. I’m confused; in this video at about 2:46 he adds a width value, increasing the size of the button. Transition is also added to give the effect on hover. But when I try to duplicate this, no transition occurs, I just get a ‘snap’ to the new width. However if I use Padding & Margins > padding right+left=30px, I can see the transition ease the width larger. Why can’t I duplicate how this is applied in the video? Also, I’m stumped why he added a “slideup” animation, for no apparent reason – it won’t show on hover, so what was the point? Anyways, full disclosure, I tried all of this on a remote (now deleted) and local server. |
Sebastian
February 8, 2019 at 11:11 am
|
Hey, Sorry for the confusion. In answer to your questions: Transiting the width So how to you transition the width of a button? You use min-width. It’s safe to set min-width to 0 (a specifically defined number) for pretty much all elements. And this will still allow the actual width to be flexible. Then, when you set the transition property, you set the min-width to be larger than the current width of the button. That way it will smoothly transition to the wider width rather than snapping to it instantly. In the video, I use the min-width property without actually mentioning the ‘min‘ bit. My bad. And I don’t set the initial min-width to zero, but the important point here is that I set it to something. The point of the animation Does this make sense? Cheers, |
majorpayne
February 8, 2019 at 3:08 pm
|
So you’re that guy in the video – kewl! Really wish you did more of them tho. Ok, your explanation ‘fixed’ the problem I was having. Followed it and now the effect works, thanks! And I appreciate the bounce animation explanation. Now it makes sense. Getting a bit off my original topic, just want to mention I’m using Oxygen . MT is a great Website building asset, and it couldn’t hurt if you popped into their Facebook group and promoted it with a “Hey I’m Sebastian from Microthemer!” |