I setup another test to prove my JS Multi-Function Link works before implementing it in the real world; it does for multiple pages in a main variant, but fails in a secondary variant (e.g.mobile) for more than one page.
In trying to identify the problem (mine or real), I copied the offending page two variant into single page site and it works as it should.
Using a variant ID "Xxr_v2_Name" works for a single page, but (and as likely my mistake) it does not seem to for the second page. All the Names are unique and I placed a check on each page to ensure I had the correct window number.
The XAR docs are attached, any thoughts on where I have made the error welcome.
FYI: the thought process behind my JS Multi-Function Link is more about navigation on a mobile variant; one can for example have a popup open where the menu is out of site, closing the popup and simultaneously bringing a menu or main heading back into view can make it easier when scrolling up and down a narrow page.
Any help as always much appreciated.
HTML Code:
// Open Popup, Close Popup and ScrollIntoView an Anchor
// Page 1 Main
javascript:document.getElementById('MainHeaderBlock').scrollIntoView({ behavior: 'smooth' });xr_ppc("xr_xp4");
// Page 2 Main
javascript:document.getElementById('MainHBPage2').scrollIntoView({ behavior: 'smooth' });xr_ppc("xr_xp20");
// Page 1 Mobile
javascript:document.getElementById('Xxr_v2_MobileHeaderBlock').scrollIntoView({ behavior: 'smooth' });xr_ppc("xr_xp12");
// Page 2 Mobile
javascript:document.getElementById('Xxr_v2_MobileHBPage2').scrollIntoView({ behavior: 'smooth' });xr_ppc("xr_xp28");
Bookmarks