I could not find an up to date answer on this, so wanted to double check.
Ideally I would like to use background-attachment: fixed to obtain a parallax effect, however I have found that this does not work on mobile phone's and tablets.
I decided to disable it by default, but use javascript to enable it if it is not a small screen size or devices with navigator.userAgent that contain things such as iPhone, iPad etc:
navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone|iPad|iPod/i) ||
navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Windows Phone/i) || navigator.userAgent.match(/Opera Mini/i) ||
navigator.userAgent.match(/IEMobile/i) || navigator.userAgent.match(/Mobile/i) || navigator.userAgent.match(/Tablet/i);
I have found that when I switch between the responsive design modes in safari, the userAgent does not update properly and often contains iPhone or iPad, when I am on a different screen.
Is there a standard/reliable way to detect if a screen supports background-attachment: fixed ?
Alternatively is there a way to get the parallax effect working on all browsers ?
Thanks
Mark