Question: Mobile menu action like toggle

Hi guys,

Recently I try to use hype4 to re-build a website for my client, I have some question about mobile menu "toggle".

Im not good for Js functional. and try find some topic like this

Have someone can teach me how to build mobile toggle for mobile device website. tks you.


hype files
https://drive.google.com/file/d/1YWD-5rW73k3bApBlPczDK4lKyprhA663/view?usp=sharing

You are on the right track. Put the menu in a symbol and create a timeline to animate it on. Clicking the hamburger menu would then continue that timeline. Use the simple directional pause approach for the menu to close itself again.

I also would consider using a persistent symbol if the animation should work across scene changes. Another thing that might come in hand would be setting the symbol to fixed position… run this on symbol load (I called the function fixedHeader):

	element.style.setProperty('position', 'fixed', 'important');
	element.style.setProperty('transform', 'none', 'important');

CleanShot 2020-09-15 at 09.16.44@2x

3 Likes

@MaxZieb
:pray: Thanks Max, I got it. I'll try Js later, this case I use double click to reverse timeline.