So, i have the following jquery:
jQuery('.button').click(function(e) {
var isMobiles = /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ? true : false;
if(!isMobiles) {
jQuery('.button').featherlight(); //lightbox function
alert("desktop");
}else{
alert("mobile");
}
})
In desktop view, I get an alert "Desktop" and featherlight lightbox.
In mobile view, I am still getting the featherlight lightbox and alert "mobile".
I am really confused to why the lightbox function still loads in mobile view when I get "mobile" alert?
Any suggestions?