Hello All:
Thank you for any help with this
Can you please help me?
I cannot see why I do not get the card image on my "cardontable" element when I use placeOnObject -
This is my tpl
this is my javascript
As shown on the attachment, an inspect shows the new cardontable_card_id element
Thanks again
Thank you for any help with this
Can you please help me?
I cannot see why I do not get the card image on my "cardontable" element when I use placeOnObject -
This is my tpl
Code: Select all
<div id="playertable" class="playertable whiteblock" >
<div id="cardontable"></div>
</div>
<script type="text/javascript">
var jstpl_cardontable = '<div class="cardontable" id="cardontable_${player_id}" style="background-position:-${x}px -${y}px">\
</div>';
</script>
Code: Select all
for (var i in this.gamedatas.cardsontable )
{
var card = gamedatas.cardsontable[i];
var color = card.type;
var value = card.type_arg;
var card_id = this.getCardUniqueID( card.type, card.type_arg );
dojo.place(
this.format_block( 'jstpl_cardontable', {
x: this.cardwidth*(value-2),
y: this.cardheight*(color-1),
player_id: card_id
} ), 'cardontable' );
this.placeOnObject( 'cardontable_' +card_id, 'cardontable' );
}
Thanks again