Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to target my randomly created ID
    primarykey
    data
    text
    <p>I have pasted all of my code to <a href="http://jsfiddle.net/Adnaves/hLGsH/" rel="nofollow">JSFIDDLE</a></p> <p>What my system should be able to do is create a house with a random ID and set a max capacity of inhabitants in the house. You can then create some people and and drag them on to the house. When 2 people are dragged on top of a house, the house will show a bounce effect and a baby will appear. </p> <p>My problem right now is that I can't seem to figure out how to target the random ID of my house. So right now if you create more than one house, but only move two people into one of them, all of the houses will "bounce" since I'm targeting the .House class:</p> <pre><code>if(this.aPeople.length == 2) { // TODO: Create a new Person setTimeout(function(){ $('.House').effect('bounce'); }, 0, function(){ } ); (From line 212) </code></pre> <p>Try to create a house in the results of <a href="http://jsfiddle.net/Adnaves/hLGsH/" rel="nofollow">JSFIDDLE</a> and click on it. Here you'll get the option to delete the house. The way I targeted my click function there was like this:</p> <pre><code>var iDivHouseId = $(this).attr('id'); $('#WindowDisplayHouseInfo').data('current-elem-id', iDivHouseId); (on line 33 and 34) </code></pre> <p>At some point I would also like the if(this.aPeople.length == 2) to include that it has to be male and female to make a baby. </p> <p>The gender I just get by: </p> <pre><code>var sPersonGender = $("#gender input[type='radio']:checked").val(); </code></pre> <p>I really hope that you can help me out with some of it or at least point me in the right direction. I'm getting a bit frustrated by looking at the same code with no progress for to long. Feel free to play around with the JSFIDDLE..</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload