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 6741987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:47:23+00:00 2026-05-26T11:47:23+00:00

<a href=javascript:; onclick=$(‘#example’).fadeIn(‘fast’);>FadeIn!</a> <div class=midbox id=example style=display:none;> Lorum ipsum<br> <br> [<a href=javascript:; onclick=$(‘#example’).fadeOut(‘fast’);>Close</a>] </div>

  • 0
<a href="javascript:;" onclick="$('#example').fadeIn('fast');">FadeIn!</a>

<div class="midbox" id="example" style="display:none;">
    Lorum ipsum<br>
    <br>
    [<a href="javascript:;" onclick="$('#example').fadeOut('fast');">Close</a>]
</div>

 

.midbox{
    display:block;
    position:absolute;
    top:50%;
    left:35%;
    padding: 8px;
}

I’ve searched through many topics on Google and here on Stackoverflow, but i can’t seem to find my answer.

I put the midbox classes just before the end of the body tag (</body>). Now i click on this link to fade the box in, but it isn’t showing up in the middle, it shows up without the css i gave it and at the bottom of the page.

Why is it doing this? Can you guys help me?
Thanks.

  • 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-26T11:47:24+00:00Added an answer on May 26, 2026 at 11:47 am

    Here you go:

    .midbox{
        display:block;
        position:absolute;
        top:50%;
        left:50%;
        width:600px;
        height:400px;
        margin-left:-300px;     /* half of width */
        margin-top:-200px;     /* half of height */
        padding: 8px;
    }
    

    DEMO

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

PHP code: <a id=a$id onclick=check($id,1) href=javascript:void(0) class=black>Qualify</a> I want to remove the onclick=check($id,1) so
<a id=a$id onclick=check($id,1) href=javascript:void(0) class=black>Qualify</a> After href is removed, is Qualify still clickable?
Having such an html: <a class=someclass href=some/url/absolute/or/relative>Blah</a> ... along with such javascript: $(a.someclass).onclick(function() {
I know that in Javascript document.location.href = #my_id tells the browser to display the
there is a script in my html tag <script type=text/javascript> function setTaxDisplay(display) { window.location.href
HI, For a tag, you can execute javascript through href or onclick. When should
We have lot of legacy inline javascript code for img onclick , href clicks
Quick Question. Should we put Javascript in the HREF or use onClick (event)? Are
How do I convert the following javascript to using JQuery? document.getElementById(asc).removeAttribute(href); document.getElementById(asc).onclick = ;
What is the difference between JavaScript's window.location.href = window.location.href and window.location.reload() functions?

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.