Hide the Header/Footer

So here is my problem

  1. I have a database of images and corresponding information
  2. The DB is connected to a pro gallery and when you click on any given image it takes you to a dynamic page i’ve created
  3. The dynamic page has no header/footer (I have changes the layout in page settings). I would like to have a back button that works to bring me back to the page and location the transition was originated from. Thus far I have tried the following code:
import wixWindow from 'wix-window';

import {session} from 'wix-storage';
import wixLocation from 'wix-location';

let previousPageURL;

$w.onReady(function () {

    previousPageURL = session.getItem("page");
    console.log(previousPageURL);
    session.setItem("page", wixLocation.url);
    $w("#btnBack").link = previousPageURL;
    $w("#btnBack").target = "_self";
});

but its not working so well and it is glitchy on mobile for some reason… So then I tried to implement the lightbox as menu method. It works ok on desktop but on mobile I wanted to turn on the mobile menu instead of the lightbox. However this is where I ran into the problem - since I changed the layout to no header/footer I don’t have the option to get the menu button in mobile… so I want to try and hide header/footer on desktop and have a lightbox and on mobile to have the hamburger…

Additionally I made an animated hamburger button for the desktop/lightbox slide-out, however when I set the onMouseIn/Out settings to trigger the hide/show of the button, it glitches and on MouseOut it does not display the animation, but since the lightbox has a close button i thought that I could link it so that the reverse hamburger animation is triggered when the slideout menu is closed, but I can’t figure out how to have the lightbox event trigger an event on a different page… so any advice on that issue would be greatly appreciated…

Thanks in advance…

Hey ilyav,

Mouse in and out will not work well on mobile, it is better to use click. You can pass data back to the page by setting another session cookie. I’m not sure if { memory } refreshes after a lightbox closes, so you might try using that instead since it has more storage potential.

thank you! - can you please provide an example or point me in the right direction, I am not really a coder so this is somewhat new to me and mostly I operate by trial and error…

It looks like you’re already using a session cookie on your page, so you would simply do the exact same process inside the lightbox after something happens.

I.e. after a user clicks on a button inside the lightbox, the value of input1 is saved as

session.setItem('lightboxdata', $w('#input1').value);

Code from forum post is from this example for back button if anybody needs.
https://www.wix.com/corvid/forum/wix-tips-and-updates/example-back-button

Old post being closed.