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

  • Home
  • SEARCH
  • 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 6131447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:58:35+00:00 2026-05-23T16:58:35+00:00

I have this javascript function that gets called after an ajax response. It contains

  • 0

I have this javascript function that gets called after an ajax response. It contains this bit of code:

// If there is a notification already, clear it and restart with the new notification.
try {clearTimeout(timeout_handle);}
catch(err){}

$('#animated_status_message').html(
    'this is a status message'
);
$("#animated_status_message").animate({top:"0"},{duration:400})
timeout_handle = setTimeout("$('#animated_status_message').animate({top:'-60px'},{duration:400})", 4000);

This is the CSS for the div:

#animated_status_message{
    background-color: orange;
    color: black;
    font-weight: bold;
    border: 1px solid black;
    margin-top: 2px;
    padding: 20px;
    z-index: 1000;
    max-width: 80%;
    position:fixed;
    opacity:0.92;
}

And finally, the html:

<div id="animated_status_message" style="top: -60px;"></div>

The javascript is probably not necessary here but just in case.

So, the problem is that the div isn’t centered. I tried a bunch of methods with margin auto and creating a parent div and adding left property to it and the the actual div holding the content.

Any idea how I can tie this all together?

Thanks
Eric

  • 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-23T16:58:36+00:00Added an answer on May 23, 2026 at 4:58 pm

    If you know the size of the div you could try this:

    #animated_status_message{
       left: 50%;
       width: 400px (just an example);
       margin-left: -200px (the width of the div divided by two);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this function in my Javascript Code that updates html fields with their
I have this simple code that speaks for itself. <script language='javascript"> function check() {}
I have some third-party Javascript that has statements like this: FOO = function() {
Ok, I have one JavaScript that creates rows in a table like this: function
Here is the situation. I have some javascript that looks like this: function onSubmit()
Hello i have this form filling javascript: function onLine(code,nn) { document.writeform.bericht.value+=code; document.writeform.bericht.focus(); document.writeform.nickname.value+=nn; write1();
As you may know, when we have this code in Javascript : function getName()
I have this bit of JavaScript... 15 $('.ajax_edit_address').each(function() { 16 $(this).ajaxForm({ 17 target: $(this).parents('table.address').find('tr.address_header').children(':first'),
I have a page that contains an iframe that gets loaded using Javascript: index.html
I have a problem with a javascript set of functions that I made. This

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.