Hello.
I have a question with "dynamic divs".
I have a div structure in the tpl file like this :
(I have child divs that I don't show in this question
)
The CSS class are :
And a js template :
In Javascript i make the div "Guildchoice" disappear according to game state :
When placing cards on self and opponent board I do this :
My question is :
When I make the 'guildchoice" appear and desappear, all my card remain static on my screen unlike the divs which shift automatically.
I understood (maybe wrong) that the "absolute position" was still refering to the parent.
How can I make my card with specific position inside my div "stick" with my div ?
(Hope my question is clear
)
I have a question with "dynamic divs".
I have a div structure in the tpl file like this :
Code: Select all
<div id="guildChoice">
</div>
<div id="backgroundGlobal">
<div id="opponentBoard_wrap" class="whiteblock">
</div>
<div id="center_wrap">
</div>
<div id="myBoard_wrap" class="whiteblock">
<div id="myBoard">
<div id="myBoard7Empty" class="player-rift"></div>
</div>
</div>
<div id="myhand_wrap" class="whiteblock">
</div>
</div>The CSS class are :
Code: Select all
.player-rift {
position: relative;
float: left;
width: 168px;
height: 0px;
margin: 1px;
}
.card {
background-image: url('img/GuildSummoners.png');
background-repeat: no-repeat;
display: inline-block;
background-size: 1100% 100%;
position: absolute;
}
.card-normal {
width:168px;
height:235px;
}
.card_light{background-position: 20% 0%;}And a js template :
Code: Select all
var jstpl_guild='<div class="card card-normal card_${guildName}" id="guild_${guildId}"></div>';In Javascript i make the div "Guildchoice" disappear according to game state :
Code: Select all
//Display or Hide the "DIV" section named "guildChoice"
if (stateName == 'guildSelection') {
dojo.style( 'guildChoice', 'display', 'block' );
dojo.style('guildChoice','height',235+'px');
if (this.isCurrentPlayerActive())
{
this.addClickActionToGuilds();
}
} else {
dojo.style( 'guildChoice', 'display', 'none' );
}Code: Select all
dojo.place(this.format_block('jstpl_guild', {guildName: GuildName.toLowerCase(),guildId: GuildId}), 'overall_player_board_'+ player_id,'last');
this.placeOnObject('guild_' + GuildId, 'overall_player_board_' + player_id);
this.slideToObjectPos('guild_' + GuildId, 'myBoard7Empty',indexHorizontal,indexVertical).play();
==> 'myBoard7Empty" is under the div "MyBoard".When I make the 'guildchoice" appear and desappear, all my card remain static on my screen unlike the divs which shift automatically.
I understood (maybe wrong) that the "absolute position" was still refering to the parent.
How can I make my card with specific position inside my div "stick" with my div ?
(Hope my question is clear