Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 919897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:37:13+00:00 2026-05-15T18:37:13+00:00

I am trying to animate a div when the user click the button. Each

  • 0

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;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T18:37:14+00:00Added an answer on May 15, 2026 at 6:37 pm

    If you add position:relative to your style it works in IE8.

    http://jsfiddle.net/NPxt6/1/

    #breakline
    {
        width:580px;
        height:100px;
        background-image:url('breakline.png');
        background-repeat:no-repeat;
        float:left;
        border:1px solid black;
        position:relative;
    }​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to animate the div within an list item with a click event
I am trying to animate a div moving 200px horizontally in JavaScript. The code
I'm currently trying to make a button which will take the user back to
I have been trying to animate a background position move from a div. The
I'm trying to animate the opacity of a div using jQuery. It works fine
i am trying to animate a div , what i need is when click
I'm trying to animate a div on hover using CSS3's @keyframes rule. The code
I am trying to find a way to animate a div using jQuery to
I'm trying to animate a logo. The markup looks like this: <div id=logo> <h1>
I'm trying to animate a div so that when the page load it has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.