Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

182
Views
Cómo acceder y cambiar la variable de la función externamente en javascript

Tengo un código externo que define la variable Modal y tampoco puedo cambiar esta declaración.

 var Modal = function (element, options) { this.options = options this.$body = $(document.body) this.$element = $(element) this.$dialog = this.$element.find('.modal-dialog') this.$backdrop = null this.isShown = null this.originalBodyPad = null this.scrollbarWidth = 0 this.ignoreBackdropClick = false if (this.options.remote) { this.$element .find('.modal-content') .load(this.options.remote, $.proxy(function () { this.$element.trigger('loaded.bs.modal') }, this)) } }

Quiero establecer el valor isShown en falso. De esta forma Modal.isShown=false; pero la propiedad isShown no es accesible. Cómo puedo acceder y cambiar su valor.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Esta es una función constructora. Pruebe el siguiente código.

 const modalNew = new Modal(elment,options); modalNew.isShown = false;

Deberá pasar el elemento y las opciones.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!