Hi all,
in the game I am developing, at dome point, I display a div in the upper part of the screen where the cards and tiles selected by players are shown.
After that, based on those cards and tiles selected, the players get victory points, tiles or resources. In order to make what is happening clear, I am moving those elements from the main board to the overall player board.
The problem is, although the animation is happening, when the elements moving cross the div in the upper part of the screen, they disappear. It loooks like they go beneath that div.
I have tried to use the z-index property in the css, but with no luck.
When I creat that div, I use this sentence to show it:
with the following css style:
An example of how I create the elements I am moving and its corresponding animation:
with the css:
I am not sure how I can make these elements visible when they move across the created div. Any help would be much apreciated.
Thanks in advance.
Lorenzo
in the game I am developing, at dome point, I display a div in the upper part of the screen where the cards and tiles selected by players are shown.
After that, based on those cards and tiles selected, the players get victory points, tiles or resources. In order to make what is happening clear, I am moving those elements from the main board to the overall player board.
The problem is, although the animation is happening, when the elements moving cross the div in the upper part of the screen, they disappear. It loooks like they go beneath that div.
I have tried to use the z-index property in the css, but with no luck.
When I creat that div, I use this sentence to show it:
Code: Select all
dojo.style('playerChosenElementsDisplay', 'display', 'inline-block');Code: Select all
#playerChosenElementsDisplay
{
position:relative;
width: 100%;
height: 300px;
border-style:solid;
border-width: 2px;
display: none;
}Code: Select all
for (i=0; i<notif.args.num_resources_2move; i++)
{
dojo.place( this.format_block( 'jstpl_resourceToken', {
RESTOKENCOLOR: notif.args.player_color,
RESTOKENPLAYERID: notif.args.player_id,
RESTOKENNUMBER:i
} ) , 'overall_player_board_'+notif.args.player_id);
var delay= i*100;
this.slideToObjectAndDestroy( 'overall_player_board_'+notif.args.player_id, 'resourceToken_'+notif.args.player_id+'_'+i, 1000, delay);
}Code: Select all
.resourceToken {
position: absolute;
width: 19px;
height: 30px;
background-image: url('img/Resources_building_peq.png');
z-index: 10;
}Thanks in advance.
Lorenzo