jquery - Woocommerce Flexslider touch functionality on desktop not working

I am using Flexslider settings in Woocommerce to modify the image slider on the single product page.Support for this

I am using Flexslider settings in Woocommerce to modify the image slider on the single product page. / Support for this is added into Woocommerce by default.

I have entered the below code into my functions.php in order to set 'touch' to true and enable finger swiping on touch devices. I have confirmed that this works on a mobile device. However this doesnt work on my Surface Pro 3 (also a touch device). It works only when in Chrome DevTools, if I press the device size toggle and then press refresh. However when I close DevTools and refresh again, it stops working.

add_filter("woocommerce_single_product_carousel_options", "change_flexslider_options", 10);
function change_flexslider_options($options) {
$options = array(
  'rtl' => is_rtl(), 
  'animation' => 'slide', 
  'smoothHeight' => false, 
  'directionNav' => true,  
  'controlNav' => true,
  'slideshow' => false, 
  'animationSpeed' => 500, 
  'animationLoop' => false,
  'touch' => true,
);
return $options;
}

I am not sure how to have flexslider recognise whether the desktop is or isnt a touch device.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745153962a4614004.html

相关推荐

  • jquery - Woocommerce Flexslider touch functionality on desktop not working

    I am using Flexslider settings in Woocommerce to modify the image slider on the single product page.Support for this

    2小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信