jquery - Change icon size on mouse over - (FontAwesome + Bootstrap) -
jquery - Change icon size on mouse over - (FontAwesome + Bootstrap) -
i want display 2x icon size on mouse on element.
i'm using fontawesome bootstrap. have list this:
<ul> <li><a href ="#"><i class="icon-inbox"></i> inbox<a/></li> <li><a href ="#"><i class="icon-print"></i> print<a/></li> .... </ul> i want add together "icon-2x" fontawesome css class, on mouse on element, display larger icon, , remove class on mouse leave.
i want fontawesome homepage examples. this:
i tried finding elemets jquery add together css class, couldn't it.
can help me?
thanks
why don't utilize css :hover?
li i[class^="icon-"] { font-size:12px; } li:hover i[class^="icon-"] { font-size:24px; } fontawesome uses font icons, double icon size double font size. of course of study you'd need cater padding, margins , whatever else ensure icon stays relative text beside it.
if still want utilize jquery add together new class:
$('li').hover(function() { $('i[class^="icon-"]', this).addclass('icon-2x'); }, function() { $('i[class^="icon-"]', this).removeclass('icon-2x'); }) jquery html css twitter-bootstrap font-awesome
Comments
Post a Comment