简体   繁体   English

边栏在悬停时扩展

[英]Sidebar that expands on hover

I'm trying to animate a sidebar with javascript that shows category icons by default and shows the category words on hover. 我正在尝试使用JavaScript设置边栏的动画,该JavaScript默认情况下显示类别图标并在悬停时显示类别词。 The closest example I can think of is this one: http://piccsy.com/ . 我能想到的最接近的例子就是这个: http : //piccsy.com/

Can anyone help me with this? 谁能帮我这个? I'm still getting the hang of javascript. 我仍然无法理解javascript。

You could do this just with CSS using .myclass:hover you'd have to check compatibility with older browsers because you will have to use css transition to animate. 您可以仅使用CSS使用.myclass:hover来做到这一点,因为您必须使用css过渡来设置动画,因此您必须检查与旧版浏览器的兼容性。 This is a good starting point CSS3 Transitions 这是CSS3 Transitions的良好起点

Or if you want to use javascript I'd recommend using JQuery 's mouseover() event function. 或者,如果您想使用javascript,我建议您使用JQuerymouseover()事件函数。 when this event is triggered you can then animate the side nav. 触发此事件后,您可以为侧面导航设置动画。

Good luck 祝好运

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM