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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:11:27+00:00 2026-05-13T22:11:27+00:00

The JS: var dialog = jQuery(‘#dialog’); dialog.animate({ ‘top’:’-4px’, ‘display’:’toggle’ }, 300); The CSS: #dialog

  • 0

The JS:

var dialog = jQuery('#dialog');
dialog.animate({
  'top':'-4px',
  'display':'toggle'
}, 300);

The CSS:

#dialog {
  display: none;
  position: relative;
  width: 180px;
  height: auto;
  margin-left: -20px;
  top: -15px;
}

The Problem:

The animate executes and the div appears into view but after the animate is done executing it hides the div again but it remains in its new animated position. I know this because it appends the inline style=”top:-4px” but the display inline style is gone after the animation executes.

The other problem is that this is a dialog window that has a cancel button so even if I add a callback of dialog.show(); after the animate completes. The cancel button does not work.

Cancel button animate:

dialog.animate({
    'top':'-15px',
    'display':'toggle'
}, 300);

This does nothing when the user clicks the cancel button. If i remove the callback from the first animate then the dialog window disappears and the user can’t click cancel.

Am I missing something obvious here? I’ve used animate before and have never run into this problem.

  • 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-13T22:11:27+00:00Added an answer on May 13, 2026 at 10:11 pm

    Instead of 'display':'toggle' use 'show':'toggle'

    This should fix both issues.

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

Sidebar

Related Questions

I'm trying to show a jquery dialog box with code like: var message =
I'm writing a jquery plugin to display a jquery ui dialog when links are
i open UI dialog in this way: var $dialog = jQuery('#dialog'); $dialog.load('mySite.aspx'); $dialog.dialog({ autoOpen:
I'm trying to position a dialog in jQuery and I have the following code.
I am using jquery dialog to display my form and I use MVC 3
The CSS: .flyoutdialog { position: absolute; top:0; left:0; border: 1px solid #CCC; background-color: white;
I use the the following code to show a dialog with jQuery UI: var
I have a jQuery dialog: // Configure buttons var dialogButtons = {}; dialogButtons[buttonConfirm] =
I have a modal dialog that is created with the following: procedure TFormCompose.createParams(var Params:
This is how my dialog is generated: $(function () { $(.btnDialog).click(function() { //e.preventDefault(); var

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.