I believe the issue is caused by the coding being shared between the desktop and mobile variant, similar to what happens with form scripting. In fact when I tried this on a simple two variant site...