Handheld footer menu sidebar toggle
-
Hi,
On mobile, how could i make one of the handheld buttons open the sidebar up as the search button opens the search bar?
I have the filtering options in the sidebar. I’m satisfied with the layout on desktop. On mobile, however, the sidebar is after the loaded results, at the bottom of the page. Needless to say, it’s not a good UX to have it there. I found some guides in reversing the order, so the filters are on top. I don’t find that to be a good solution though either. I’d like it to be toggle-able, to appear just like the search bar does from the handheld footer menu.
If you don’t know the answer to this specifically but you could tell me how the search bar is displayed upon tapping its icon to above the content, so I may try and hack the sidebar’s code into the same type of process, that would also help!
Thanks in advance guys!
-
Hi @rolandlorincz,
> On mobile, how could i make one of the handheld buttons open the sidebar up as the search button opens the search bar?
Good question! You can look at this forum reply to see how to add / move around handheld items:
https://ww.wp.xz.cn/support/topic/editing-handheld-footer-middle-button-and-or-button-order/My suggestion would be this:
1. Add or replace an existing section in the handheld bar
2. Write some JavaScript that will conditionally load a sidebar on the click of your new handheld button
3. You can see how the search bar is displayed conditionally by looking at this:
https://github.com/woocommerce/storefront/blob/master/assets/js/navigation.js#L8-L15What’s going on is that the JavaScript adds a class when clicked, and CSS is used to show that section when that class is applied.
Best,
The topic ‘Handheld footer menu sidebar toggle’ is closed to new replies.
