Hi guys. I am trying to animate a div when the user click the button. Each button will move a div to a different amount of pixels. My code works in firefox and chrome but not IE8 (I only test it in IE8 so far). I appreciate it if someone could help me about it.
my jquery
$(document).ready(function(){
function breakline(position) {
$('#breakline').animate({ //this code won't work...
top:position},'slow');
$('#breakline').hide(); //this code would work. I put it here just for testing
//purpose
};
$('#project a').click(function(){
breakline(256);
});
$('#code a').click(function(){
breakline(200);
});
$('#skill a').click(function(){
breakline(236);
});
$('#about a').click(function(){
breakline(190);
});
$('#contact a').click(function(){
breakline(200);
});
});/* ready */
my html
<body>
<div id="main">
<div id="menu-wrapper">
<ul id="menu">
<li id="project"><a href="#"></a></li>
<li id="code"><a href="#"></a></li>
<li id="skill"><a href="#"></a></li>
<li id="about"><a href="#"></a></li>
<li id="contact"><a href="#"></a></li>
</ul>
<div id='breakline'> </div>
</div> <!-- menu wrapper -->
</body>
</HTML>
part of CSS
#breakline
{
width:580px;
height:100px;
background-image:url('breakline.png');
background-repeat:no-repeat;
float:left;
border:1px solid black;
}