I suggest that you add a unique identifier on each link, for example, if the page is a dashboard one, and you want to open certain sections, you can link to them like this on your “page 1”:
$w('#details').link = `/dashboard?section=details`;
$w('#account').link = `/dashboard?section=account`;
$w('#notifications').link = `/dashboard?section=notifications`;
// And so on ..
And on your second page, use wixLocation.query to get the query of the page and decide which box to expand:
import wixLocation from 'wix-location';
$w.onReady(() => {
chechQuery();
})
function chechQuery() {
let query = wixLocation.query;
if (Object.keys(query).length > 0) {
if (typeof query.section === 'string') {
const section = query.section;
switch (section.toLowerCase()) {
case 'details':
$w('#detailsBox').expand();
break;
case 'account':
$w('#accountBox').expand();
break;
}
}
}
}
And that’s it, you can tune it and adjust it to your needs.