IRRITATING MAGNIFY EFFECT ON MOUSE HOVER

Goti Bandu

Total Post:119

Points:835
Posted by  Goti Bandu
 923  View(s)
Ratings:
Rate this:
Hi Expert,

I have three link enclosed with ul li tag.I want my each link to magnify when someone mouse hover it. I know it can be done using absolute positioning and z-index. I tried something but I am not getting it right.T he problem with my jsFiddle is the 2nd li element after magnifying takes two line.

Can someone help me with it.

Here is my HTML

<ul>
<li> <a href="#">Home</a> </li>
<li> <a href="#">About us</a> </li>
<li> <a href="#">Contact us</a> </li>
</ul>

Here is my Jquery

$(function(){
var t = 10;
$('li').each(function(e,i){
    $(this).offset({top:50,left:t});
    t+=100;
});

$('a').hover(function(){
    $(this).animate({'z-index':'1','font-size':'30px'},50);
      },
      function(){
          $(this).animate({'z-index':'0','font-size':'15px'},50);
    });
});

Here is CSS :

a {
text-decoration:none;
font-size: 15px;
}
ul {
list-style-type:none;
}
li {
padding-left: 50px;
width:100px;
text-align:center;
position:absolute;
}

Thanks in advance for any recommendations or solutions.
  1. AVADHESH PATEL

    Post:604

    Points:4228
    Re: Irritating magnify effect on mouse hover

    Hi Expert,


    you have to modify your css to adjust the white-space

    li {
        padding-left: 50px;
        width:100px;
        text-align:center;
        position:absolute;
        white-space:nowrap;
    }

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!