WeLoveCSS Logo
Home Profile Members Search Rules Help New Posts



WeLoveCSS > PROGRAMMING LANGUAGES > Scripting and Server Side > [SOLVED] SnapJS Mobile Menu

Reply
  Thread Tools Display Modes
Old 6th May 14, 12:26 PM   #1
Neji
WLC Member
 
Join Date: Apr 2009
Posts: 24
Default SnapJS Mobile Menu

Hi,

I'm trying to setup a Wordpress starter theme with an out-of-the-box mobile menu. I'm using SnapJS to create a slide out menu.

It's working fairly well - almost perfectly but I've run in to one issue that I just cannot fix.

You can find the menu in it's current state here: http://sandbox.benpalmer.me/flow/test/

The problem is that if you scroll down the page (in a browser width less than 700px) then hit the menu button, the menu will slide out but the content (in #wrapper) will jump back to the top.

I know precisely why this is happening - the positioning switches to fixed with a top set to 0px.

I've got the following JS setup:

Code:
snap.on('open', function() {

	wrapper.css({
		'top': '-' + $('body').scrollTop() + 'px'
	});
		

});
This almost does what I need but it basically jumps to the top and then scrolls down to this position.

I'm fairly sure in saying that this animation is coming from Snap but I can't track it down. Could anyone give me a hand here?

Thanks!
Neji is offline   Reply With Quote
Old 7th May 14, 07:51 AM   #2
Neji
WLC Member
 
Join Date: Apr 2009
Posts: 24
Default Re: SnapJS Mobile Menu

You can ignore this - I fixed it by setting the transitionSpeed to 0.
Neji is offline   Reply With Quote
Reply


Thread Tools
Display Modes
Linear Mode Linear Mode

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:46 AM.



Home | Advertise | Contact Us | Top
Home | Advertise | Contact Us | Top

Copyrightę 2006 WeLoveCSS.com. All Rights Reserved.
Powered by vBulletin Version 3.8.4 Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.