Pin element to the middle of the screen

I designed a homepage with a video background and want the logo and navigation to be pinned to the middle of the screen. The only element I could find that I can pin to the middle is a light box. The problem is that the light box only appears once per site visit, meaning that whenever a user navigates away from the page and back again, the home page turns to a dead end as there is no navigation!

I would appreciate any suggestion. It is important that logo and navigation are centred horizontally AND vertically.

Thanks
Claudia

A lightbox can pop up whenever you set it. You can pop it up every time a user navigates to the page if you want.

I wrote to Wix and they say it will only pop up once and I can’t find anything in settings. Had a programmer look into it and he couldn’t find it. If you could tell me where that setting is that would be amazing.

https://support.wix.com/en/article/setting-which-page-your-lightbox-appears-on

@givemeawhisky Thanks, but this does not make the lightbox appear every time a user goes back to the page from within the site. Mine only appears again when reloading the site.

@designstudio
Yes so then set the trigger so that it appears when the user does something on the page like moves to a certain area on your website or clicks on an element etc.
No: The lightbox does not appear when a site visitor enters a page. Instead, you can link to it from elements on your site.

You don’t have to just use the simple yes option and have it appear on every page when the user first loads up the page.
Yes: Your lightbox is displayed when a page loads. Click the Which pages is it on? field and select the pages you want the lightbox to appear on, or select the First page visitor sees checkbox.

A trigger would only load the light box and not the homepage. I wanted the trigger (company’s logo in the header) to return the user to the homepage. When getting to the homepage the light box needs to appear. Currently it does only load once, so any subsequent return to the homepage means there is no light box. As the light box contains the navigation, the user is stranded there.

My workaround is that I added the video from the homepage as the background of the light box. By doing that I created a light box that looks the same as the homepage. In terms of the web address the user is still on the page they triggered the light box from though.

To sum it up I have found a solution but I have not found answers to my questions:

  1. How can I make a light box load automatically every single time a page is visited
  2. How can I pin an element other than a light box to the middle of the screen.

So anybody who could truly answer either of these questions I’d love to hear it!
Thanks

https://support.wix.com/en/article/pinning-an-element
https://support.wix.com/en/article/about-pin-to-screen-6838335
https://support.wix.com/en/article/creating-a-floating-menu

Pinning an element is not however a code related issue and you would be better going through Wix Support for more help on pinning.

For the lightbox to load every time a page is visited and not just the first time the user views it, then simply do something like an onViewportEnter event handler function at the top of your page in your site code so that when any page loads that function will kick in and trigger the lightbox to show.

Thanks!

Pinning an element to the centre of the screen is currently not a regular option with anything other than a light box, so it would have to be solved by code if that is possible

Could you expand on the code for having the light box appear every time?

import wixWindow from 'wix-window';
$w.onReady(() => {
    wixWindow.openLightbox("LightboxName");
})

Thanks,
I replaced the code that was there for the home page with the code above, changed the lightboxname to my light box but it still doesn’t come up…
So I guess I’m doing it wrong?

Post your code here

Brilliant! it works. I do however get a bug message:
ReferenceError: wixWindow is not defined

arrghhh sorry still doesn’t work. Had my page still set to my work around. Homepage still only loads light box once per session

To confirm, my homepage code now reads:

// For full API documentation, including code examples, visit Velo API Reference - Wix.com

$w.onReady( function () {
//TODO: import wixWindow from ‘wix-window’;
$w.onReady(() => {
wixWindow.openLightbox(“Navigationhomepage”);
})

});

You have an error. Your page should only have my code. Delete all the other stuff (but use your lightbox name as you did).

That’s what I did first and what didn’t work. See my post from 3 hours ago. You simply replied “Post your code here” So I replaced “write your page related code” in the below code:

// For full API documentation, including code examples, visit Velo API Reference - Wix.com

$w.onReady( function () {
//TODO: write your page related code here…

});

Thanks for your help so far

Delete these lines:

/ /For full API documentation, including code examples, visit https://wix.to/94BuAAs

$w.onReady(function () {
 //TODO: write your page related code here...

});

And use my code only.

I had a hyphen in my lightbox name initially. That seems to have stopped your code from working before. It now works! Thanks

Your welcome (hyphens shouldn’t be a problem, but maybe there’s a bug).