How to get back my hover after resetting color with jQuery?

I have this little jQuery-code working, but there's one thing I can't figure out. After I have clicked my infocontent-menu, the h1:hover is gone. How do I get the hover function back? HTML:

Wat?

Van/ voor wie?

Akties

Met wie?

CSS: .infocontent { width: 120px; height: 120; float: left; } .infocontent h1 { width: 100%; font-size: 24px; text-transform: uppercase; color: #999; } .infocontent h1:hover { color: #000; } jQuery: $('.infocontent h1:first').css('color', '#000'); $(".infocontent h1").on("click", function() { $('.infocontent h1').css('color', '#999'); $(this).css('color', '#000'); }); [Demo][1] [1]: http://jsfiddle.net/FXetb/

以上就是How to get back my hover after resetting color with jQuery?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏