0

Problem with animation of two overlapped div components

asked 2008-11-04 10:28:41 +0800

Emanuele gravatar image Emanuele
117 1

updated 2008-11-04 10:30:17 +0800

Hi,

I'm facing a problem with animation. I simplified my example to post it on the forum. I have 2 div components. The 1st is visible, while the 2nd is NOT visible. Pushing on buttons, the state of two div components is changed (the 1st is setted to visible = false, while the 2nd to visible = true). Pushing again on buttons, the state of two div components is changed again (the 1st is setted to visible = true, while the 2nd to visible = false), and so on... many times like you want...

When each of two div components is hided, I want to see an animation, for example anima.puff(). The problem is that this behavior is not performed correctly, probably because each of two components should be viewed in the same position in the page and so they are overlapped.

This the example code:

<window>
<div id="t1" action="onhide: anima.puff(#{self})">
<borderlayout height="300px">
	<west>Label</west>
	<center>
		<box>
			<tablelayout columns="3">
				<tablechildren>
					<panel>
						<panelchildren>
							<image src="/images/user/128/door.png"/>
						</panelchildren>
					</panel>
				</tablechildren>
				<tablechildren>
					<panel>
						<panelchildren>
							<image src="/images/user/128/door.png"/>
						</panelchildren>
					</panel>
				</tablechildren>
				<tablechildren>
					<panel>
						<panelchildren>
							<image src="/images/user/128/door.png"/>
						</panelchildren>
					</panel>
				</tablechildren>
				<tablechildren>
					<panel>
						<panelchildren>
							<image src="/images/user/128/door.png"/>
						</panelchildren>
					</panel>
				</tablechildren>
				<tablechildren>
					<panel>
						<panelchildren>
							<image src="/images/user/128/door.png"/>
						</panelchildren>
					</panel>
				</tablechildren>
				<tablechildren>
					<panel>
						<panelchildren>
							<image src="/images/user/128/door.png"/>
						</panelchildren>
					</panel>
				</tablechildren>
			</tablelayout>
		</box>
	</center>
	<east>
		<button label="toggle" onClick="t1.visible = !t1.visible; t2.visible = !t2.visible"/>
	</east>
</borderlayout>
</div>
<div id="t2" visible="false" action="onhide: anima.puff(#{self})">
<borderlayout height="300px">
	<west>Pippo</west>
	<center>
		<box>
			<tablelayout columns="3">
				<tablechildren>
					<panel>
						<panelchildren>
							<image src="/images/user/128/bed.png"/>
						</panelchildren>
					</panel>
				</tablechildren>
				<tablechildren>
					<panel>
						<panelchildren>
							<image src="/images/user/128/bed.png"/>
						</panelchildren>
					</panel>
				</tablechildren>
				<tablechildren>
					<panel>
						<panelchildren>
							<image src="/images/user/128/bed.png"/>
						</panelchildren>
					</panel>
				</tablechildren>
				<tablechildren>
					<panel>
						<panelchildren>
							<image src="/images/user/128/bed.png"/>
						</panelchildren>
					</panel>
				</tablechildren>
				<tablechildren>
					<panel>
						<panelchildren>
							<image src="/images/user/128/bed.png"/>
						</panelchildren>
					</panel>
				</tablechildren>
				<tablechildren>
					<panel>
						<panelchildren>
							<image src="/images/user/128/bed.png"/>
						</panelchildren>
					</panel>
				</tablechildren>
			</tablelayout>
		</box>
	</center>
	<east>
		<button label="toggle" onClick="t1.visible = !t1.visible; t2.visible = !t2.visible"/>
	</east>
</borderlayout>
</div>
</window>


Has anyone faced the same problem and solved it?

Thanks for all!
Emanuele

delete flag offensive retag edit
Be the first one to reply this discussion!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2008-11-04 10:28:41 +0800

Seen: 143 times

Last updated: Nov 04 '08

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More