Page 1 of 1

Abnormal movement of the div after slideToObjectAndDestroy or fadeOutAndDestroy

Posted: 14 April 2017, 08:06
by kenciro
Abnormal movement of the div after slideToObjectAndDestroy or fadeOutAndDestroy

Good morning,
I have a DIV with her DIV children:

Code: Select all

<div>
<div id="token_1" class="token [...]"></div>
<div id="token_2" class="token [...]"></div>
<div id="token_3" class="token [...]"></div>
<div id="token_4" class="token [...]"></div>
<div id="token_5" class="token [...]"></div>
</div>
When I destroy a child using slideToObjectAndDestroy or fadeOutAndDestroy all childrens, declared under the one erased, moving 100 | 150 pixels up in the browser. Childrens declared up the one erased remain in their position.

Can someone explain this abnormal movement of children?

Re: Abnormal movement of the div after slideToObjectAndDestroy or fadeOutAndDestroy

Posted: 14 April 2017, 08:55
by Andy_K
Are your tokens using position absolute?

Re: Abnormal movement of the div after slideToObjectAndDestroy or fadeOutAndDestroy

Posted: 25 April 2017, 03:14
by Victoria_La
Yes, these function only work with absolute positioning which I personally don't like at all.
I created similar functions to use on object with no inline positioning, the available in sharedcode project here
https://github.com/elaskavaia/bga-share ... redcode.js