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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:40:20+00:00 2026-06-14T18:40:20+00:00

I got two DIV container each of it contains a puzzle (realization with jquery

  • 0

I got two DIV container each of it contains a puzzle (realization with jquery draggables).

I also got one object which looks like:

var puzzle var puzzle = {
    option1 = [],
    init:function(container) { .... }
}

To start the puzzle for one DIV i use:

// left puzzle div
var puzzleLeft = puzzle;
puzzleLeft.init(leftContainer);

// right puzzle div
var puzzleRight = puzzle;
puzzleRight.init(leftContainer);

But for the left one its not working. Everything I’m going to do left, happens in the right one :/ When I uncomment the start code for the right one, it will work for the left 🙂
Seems to be the right one start code is wrong?
Is this a wrong way to create 2 instances of the puzzle?

Thanks
Matt

  • 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-14T18:40:23+00:00Added an answer on June 14, 2026 at 6:40 pm

    You can create class’ constructor instead of object:

    function Puzzle(){
       var self = this;
    
       self.option1 = [];
       self.init = function(container) { .... };
    }
    

    And create two instances of it:

    // left puzzle div
    var puzzleLeft = new Puzzle();
    puzzleLeft.init(leftContainer);
    
    // right puzzle div
    var puzzleRight = new Puzzle();
    puzzleRight.init(rightContainer);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ive got two DIV elements one of which has absolute position (lower left corner
I got two divs, one is a background and the other is the container
So Basically I have a <div> which contains two buttons. I want to position
I'm trying to design a layout with css, I got one main container(div) and
I've got three div's I'm working with: main , which is a container for
I've got two spans in a div. I want to align them next to
I got two data storages in my Windows Azure account. One is for the
I got two models which are related via ForeignKey in Django. (I am using
I got two gridviews in the same page, which basically displays the same type
I've got two input boxes in a div, I want to hide that div

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.