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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:35:01+00:00 2026-06-03T13:35:01+00:00

Recently I asked a question, how to bind commands to .fadeIn() events without having

  • 0

Recently I asked a question, how to bind commands to .fadeIn() events without having to call .trigger('fadeIn') every time they are to be called. I got a very good solution, in this post.

However I tried to do the same procedure for the .hide() event like this:

var _old = $.fn.hide;
$.fn.hide = function(){
    var self = this;
    _old.apply(this,arguments).promise().done(function(){
        self.trigger("hide");
    });
};

It seems to work in general, as is shown in this jsfiddle: http://jsfiddle.net/gEVsX/5/

But when I add this to the script, I am getting an error from a seemingly unrelated location. It is being thrown from this section of script:

    $('#unique_div_id').dialog({
        autoOpen: false,
        show: "blind",
        hide: "explode",
        modal: true,
        buttons: {
            Cancel: function(){
                $(this).dialog("close");
            }
        }
    });

Which just initializes a div to be a modal dialog. I assume I am getting this error because I have messed up the jQuery hide code. I am getting this error:

Uncaught TypeError: Cannot call method ‘addClass’ of undefined

I have replicated the error in this jsfiddle: http://jsfiddle.net/gEVsX/6/

Does anyone know how I can fix my .hide() function wrapper script?

Thanks a lot!

  • 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-06-03T13:35:03+00:00Added an answer on June 3, 2026 at 1:35 pm

    You’ve broken the contract of the hide() method, which is suppsoed to be chainable.

    You need to return this; from your new hide().

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

Sidebar

Related Questions

Recently I have been asked an interview question What are the events order in
I recently asked another question pertaining to avoid having to use boilerplate exceptions when
I recently asked a question about some problems I was having getting MIT Kerberos
I've recently asked a question regarding IE8 issue. After some time the problem was
I recently asked a question about what I called method calls. The answer referred
I recently asked a question about formatting JavaScript code in Vim. And I've also
I recently asked the question Is the behavior of return x++; defined? The result
I recently asked this question: MS SQL share identity seed amongst tables (Many people
I've recently asked a question about clipping an image via path at view's drawRect
Recently I have asked a question about what I should use to create self-contained

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.