Page 1 of 1

[SOLVED]Slide To player_board_ + id

Posted: 24 September 2015, 10:14
by Rudolf
Hello,
well I remember have solved this before, but I don't remember how ...
I've got a pb to transfert an object from the page to the player_board_id ...
I've tried three ways (which works but the object goes under the player_board:

Code: Select all

//var player_board_div = $('player_board_'+this.getActivePlayerId());
//var player_board_div = $('overall_player_board_'+this.getActivePlayerId());
var player_board_div = $('pb_media_'+this.PlayerColor2Id[this.getActivePlayerId()]+'_'+$count);
 this.slideToObject( myobj, player_board_div).play();    
with in setup...

Code: Select all

// player board on marge  
                dojo.place( this.format_block('jstpl_player_board',{ id:player_id, playercolor:colorId, gamecolor:this.PlayerGameColor[cid]} ), player_board_div );     
and tpl...

Code: Select all

var jstpl_player_board = '\
    <div id="pb_div_${playercolor}">\
        <p>\
        <span id="pb_atk_${playercolor}"  style="color:${gamecolor}; text-align:center; font-weight:bold"  >ATK: +</span>\
        <span id="pb_pot_${playercolor}"  style="color:black; text-align:center; font-weight:bold">0</span>\
        <div id="pb_media_${playercolor}_0">\
        </div>\
        <div id="pb_media_${playercolor}_1">\
        </div>\
        <div id="pb_media_${playercolor}_2">\
        </div>\
        <div id="pb_media_${playercolor}_3">\
        </div>\
    </div>';
I've tried also in changing z-index of object: 0 stays under , 1 stays upper but not inside...
I've also tried to change div with span... same effect...
so each time object goes under... and no script error ( all the object exists)
But for example 'ATK' is well at his place in playerboard, as 'score' ... but not other objects...

right now, I've got a Solution:
I've found a trick to solve this which consists to grow my pb_media_ div and put upper with z-index and coordinates...
which means objects don't belong to player_board_id... and that's not what I wish!
But it's heavy... and I think there is a simpler solution?
Is there something to do like changing "parent object"?
Thanks.

Re: Slide To player_board_ + id

Posted: 24 September 2015, 10:47
by Rudolf
I've found... it's solved.
this.attachToNewParent( myboj, player_board_div );