Page 1 of 1

Slide to position after last item of player_board

Posted: 24 January 2021, 14:42
by Bids
Hi,
I'm wondering why my object does not end up in the same positon when doing

Code: Select all

dojo.place( this.format_block('jstpl_cardwon',{player_id : player_id, turn : turn_id, x : 300}), 'player_board_' + player_id);
vs

Code: Select all

this.placeOnObject('cardwon_' + player_id + '_' + turn_id, 'player_board_' + player_id);


With the first dojo.place it's placed after the last item in player_board, that makes sense to me. But with the second one it's place somewhere in the middle of the player_board, because I imagine like placeOnObject says, it places it just on the object 'player_board';

So what's the most elegant way to slide it to position after the last item in player_board?

Thanks a lot for your help!

Re: Slide to position after last item of player_board

Posted: 25 January 2021, 07:36
by Tisaac
Most elegant would be to create a phantom div with same size that you place with dojo and use slide to this object and hook up end of animation to replace phantom div by the one that slided

Re: Slide to position after last item of player_board

Posted: 26 January 2021, 22:32
by Bids
I was thinking of that option but I was hoping that would not be the 'most elegant' way. Many thanks for your answer!