I am trying to disable the touchEnabled option for the bxSlider library if the user has a desktop browser.
if(navigator.userAgent.match(/Chrome|Mozilla|Safari/)){
$('.theSlider').bxSlider({
touchEnabled: false
});
}
//Html slider
<ul class="theSlider">
When debugging in the developer tools console in Chrome I get touchEnabled is not defined when trying to set it to false. What am I doing wrong?
undefined
? How do you inspect it? – Quentin Jul 18 '17 at 10:58$('.theSlider').bxSlider
. So my best guess is that touchEnabled is undefined somehow. – user3586417 Jul 18 '17 at 11:03undefined
? Where do you seeundefined
displayed? Perhaps a screenshot of your developer tools (is it in the developer tools you see that?) would help? – Quentin Jul 18 '17 at 11:06if(navigator.userAgent.match(/Chrome|Mozilla|Safari/)) { $('.theSlider').bxSlider({touchEnabled : false}); }
and the error message I am getting now is touchEnabled is not defined. – user3586417 Jul 18 '17 at 11:12