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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:07:43+00:00 2026-05-14T14:07:43+00:00

Yes, I know the title sounds a little suspicious. I will try to explain

  • 0

Yes, I know the title sounds a little suspicious. I will try to explain this the best I can…

The code below is supposed to have the blue div slide down beside the red div. (Directly to the right – using the position() utility of jQuery UI) The first time you hit the Show the div button, it works. Also, the Hide the div works.

Then when I click to show the div again, it appears to the right of where it is supposed to be! Why is this?!?

Note: You can find a live example of the code here

<html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Demo</title>
<style type='text/css'>

#red {
    background-color: red;
    width: 200px;
    height: 150px;
    position: absolute;
}

#blue {
    background-color: blue;
    width: 150px;
    height: 200px;
    position: absolute;
    display: none;
}

#tester_1 {
    top: 300px;
    left: 300px;
    position: absolute;
}

#tester_2 {
    top: 350px;
    left: 300px;
    position: absolute;
}

</style>
</head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jqueryui.js"></script>
<script type='text/javascript'>

function Show()
{
    $('#blue').position({
            of: $('#red'),
            my: 'left top',
            at: 'right top'}).slideDown();
}

function Hide()
{
    $('#blue').hide();
}

</script>
<body>
<div id='red'></div>
<div id='blue'></div>
<button id='tester_1' onclick='Show()'>Show the <kbd>div</kbd></button>
<button id='tester_2' onclick='Hide()'>Hide the <kbd>div</kbd></button>
</body>
</html>
  • 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-14T14:07:43+00:00Added an answer on May 14, 2026 at 2:07 pm

    Try just resetting the blue div… I did this and it appears to work on Chrome and IE now.

    function Hide()
    {
        $('#blue').css({ left: 0, top: 0 }).hide();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Yes I know, this title isn't really helpfull but this is the exact problem.
(Yes I know I can call Java code from Scala; but that is pointless;
Yes, the title is confusing, but I will keep this simple. Imagine a photo
How can we set the button title for a button,i know this answer its
I´m trying to code a tooltip (Yes I know, I have my reasons to
I have the following code (Yes I know it's quite long winded, but I
I have an AXIS2/JAX-WS web service using a code first implementation (yes I know,
I know this question will sound like a from the past thing but I
I know, the title sucks... not sure how to explain what I'm asking, so
I know that __builtin__ sorted() function works on any iterable. But can someone explain

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.