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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:10:47+00:00 2026-05-15T17:10:47+00:00

Greetings, I’m trying to override or extend the Element.show() and .hide() methods in mootools

  • 0

Greetings,
I’m trying to override or extend the Element.show() and .hide() methods in mootools in order to add some WAI-Aria toggling. I was trying to use the Class.Refactor() method like this:

 Element = Class.refactor(Element, {

 show: function(displayString) {
   result = this.previous(displayString);
   // Do my thing
   return result;
 },

 hide: function() {
   result = this.previous();
   // Do my thing
   return result;
 }

});

however, this is not working, previous is null and I think the reason is that Mootools injects those methods through Element.implement. So the methods are not native?

I have figured out how to completely replace .show and .hide but I would like to retain all of their existing functionality and just add to it. Any ideas?

  • 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-15T17:10:47+00:00Added an answer on May 15, 2026 at 5:10 pm

    not a refactor guy myself, but you can always do it ‘old school’ and save the previous function in a variable (_prev_show and _prev_hide for example), then do your override and call those functions from your new methods.

    second option would be to try extending Element into itself and call this.parent(), this is the ‘unsafe’ version of Class.Refactor. [reference]

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

Sidebar

Related Questions

Greetings everyone and thank you for checking out my post. I am trying to
Greetings, I am trying to learn pointers in C, I simply want my addtwo
Greetings, Trying to sort through the best way to provide access to my Entity
Greetings! I'm trying to have a UIWebView controlled from generated events. Is there a
Greetings, With javascript, I am trying to make a very easy animation, an image
Greetings Friends, I am trying to overlay the simple 2D game I am developing
Greetings all. I am writing some code using the Boost Units library and have
Greetings, I've read some threads about this topic, but actually I was unable to
Greetings! I am trying to find a way in Java to programmatically enable/disable a
Greetings! I am trying to find a way in Java to programmatically enable/disable a

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.