Grid Product Gallery issue with going back to the position that a visitor was on when hit the back button

Hi All,

I am using Grid Product Gallery on one of my page. I have an issue when the customer clicks a product and view the product page and hit back button and lost the location on grid product gallery where he/she was.

I raised a ticket for this but currently there is no option available.

I am investigating if there is any alternative way using Corvid. I have tried to create a code but it does not quite do what I am looking for.

On my page where product grid gallery is located, I am storing the cursor location using the onMouseln event. Actually I wanted to store this info when there is a mouse click but there is no onClick event for the product grid gallery.

Can anyone advise if there is any alternative or any way to use onClick event on Product Grid Gallery?

Thanks.

// For full API documentation, including code examples, visit http://wix.to/94BuAAs
import wixWindow from ‘wix-window’;
import {session} from ‘wix-storage’;

let CursorX = session.getItem(‘PageScrollX’); // “value”
let CursorY = session.getItem(‘PageScrollY’); // “value”

console.log(CursorX);
console.log(CursorY);

$w.onReady(function () {
wixWindow.scrollTo(Number(CursorX),Number(CursorY));
});

export function gridGallery1_mouseIn(event) {
//Add your code for this event here:
wixWindow.getBoundingRect()
.then( (windowSizeInfo) => {
let windowHeight = windowSizeInfo.window.height; // 565
let windowWidth = windowSizeInfo.window.width; // 1269
let documentHeight = windowSizeInfo.document.height; // 780
let documentWidth = windowSizeInfo.document.width; // 1269
let scrollX = windowSizeInfo.scroll.x; // 0
let scrollY = windowSizeInfo.scroll.y; // 120
console.log(scrollX);
console.log(scrollY);
session.setItem(‘PageScrollX’, scrollX);
session.setItem(‘PageScrollY’, scrollY);
} );
}