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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:01:16+00:00 2026-05-26T05:01:16+00:00

I open a popin in element .popin-foto . When I try open sub class

  • 0

I open a popin in element .popin-foto. When I try open sub class popin in same element it’s not works.

The code

this is the parent

function Popin(container, titulo, url_listagem) {
    this.url_listagem = url_listagem;
    this.titulo = titulo;
    this.overlay = $(".popin-overlay");
    this.closeButton = $(".popin-close");
    this.container = container;
}

Popin.prototype.header = function() {
    var dados = {titulo: this.titulo};
    var html = $.tmpl("header", dados);
    this.container.append(html);
};

Popin.prototype.body = function() {
    var html = $.tmpl("body");
    this.container.append(html);
};

Popin.prototype.footer = function() {
    var html = $.tmpl("footer");
    this.container.append(html);
};

Popin.prototype.close = function() {
    var self = this;

    this.container.hide(100,function(){
        self.overlay.fadeOut('fast');
    });

    $(".popin-header").remove();
    $(".popin-body").remove();
    $(".popin-footer").remove();
};

Popin.prototype.open = function(){
    var self = this;

    this.header();
    this.body();
    this.footer();

    this.closeButton.click(function(){
        self.close();
    });

    this.overlay.fadeTo("fast", 0.8, function(){
        self.container.show();
    });
};

the sub class

function PopinFoto(){}

PopinFoto.prototype = new Popin($(".popin-fotos"), "fotos", "fake_url");
PopinFoto.prototype.open = function(){
    Popin.prototype.open.call(this);
    $(".enviar-foto").die().live('click', function(){
        //do something
    });
};

So, I do this:

var popin = new Popin($(".popin-foto"), "title", "link");
popin.open();
popin.close();

var popinFoto = new PopinFoto($(".popin-foto"), "title", "link");
popinFoto.open(); //this not works
popin.close();

And in console, no error was raised.

Can you help me?

  • 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-26T05:01:16+00:00Added an answer on May 26, 2026 at 5:01 am

    it looks like your subclass isn’t being set up properly, as you are setting the subclass’s prototype to a concrete instance of the super class.

    i’m not sure exactly what you’re trying to achieve, but i’d wager that the subclass constructor needs to call the super class constructor directly, something like this:

    function PopinFoto(container, titulo, url_listagem){
        Popin.call(this, container, titulo, url_listagem);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Open up a Rails console and enter this: 2.weeks.ago.between? 2.weeks.ago, 1.week.ago Did it give
I open a connection like this: Using conn as New OdbcConnection(connectionString) conn.Open() //do stuff
I put this below code inside my *.dll for Internet Explorer. FILE *child =
I'm using the following code to try to read the results of a df
# file1.py class _Producer(self): def __init__(self): self.chunksize = 6220800 with open('/dev/zero') as f: self.thing
I want to open a process from C code, and be able to read
I have the following code: sourcefile = open(filein, r) targetfile = open(pathout, w) content=
I have this code here import subprocess from time import strftime # Load just
Open source implementation will be preferred.
Open Ankh seems to be using Subversion 1.6.2 and Tortoise uses Subversion 1.6.0. After

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.