WooCommerce产品图像缩放选项的可用参数详细信息 [英] Available parameters details for WooCommerce product image zoom options

查看:278
本文介绍了WooCommerce产品图像缩放选项的可用参数详细信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

道歉,如果这些是非常基本的问题,但我想了解Woocommerce的钩子.

Apologies if these are very basic questions but I'm trying to understand Woocommerce hooks.

在下面的文章中,答案非常有帮助地列出了钩子woocommerce_single_product_zoom_options的可用参数:

In the post below, the answer very helpfully sets out the available parameters for the hook woocommerce_single_product_zoom_options:

在woocommerce 3中调整产品图像的缩放放大系数

是否有所有挂钩和相关参数的档案?我查看了Woocommerce,可以找到挂钩列表,但是它没有提供有关参数的信息.

Is there a archive of all hooks and the relevant parameters? I looked on Woocommerce and could find the hook list but it didn't provide info on the parameters.

非常感谢您的帮助.

推荐答案

您可以在woocommerce_single_product_zoom_options钩子的所有可用参数. WooCommerce插件中包含的1/assets/js/zoom/jquery.zoom.js"rel =" nofollow noreferrer> jquery.zoom.js文件,但此文件中未记录它们.但是正如您所看到的,它是一个jQuery插件,因此有一些文档:

You can find all available arguments for woocommerce_single_product_zoom_options hook on jquery.zoom.js file included in the WooCommerce plugin, but they are not documented on this file. But as you can see it's a jQuery plugin, so there is some documentation:

杰克·摩尔(Jack Moore)的jQuery Zooom插件文档

因此,详细的可用选项参数为:

So the detailed available option arguments are:

  • url -(默认值为false)-要显示的大照片的网址.如果未提供url,则zoom将在分配给该元素的元素内使用第一个子IMG元素的src.
  • on (默认值为'mouseover'):触发缩放的事件类型.从鼠标悬停,抓取,单击或切换中进行选择.
  • duration (默认值为120):大图像的fadeIn/fadeOut速度.
  • target (默认值为false):一个选择器或DOM元素,应用作缩放图像的父容器.
  • touch (默认值为true):启用通过触摸事件的交互.
  • magnify (默认值为1):此值与缩放后的图像的整个尺寸相乘.默认值为1,表示缩放后的图像应为其自然宽度和高度的100%.
  • callback (默认值为false):加载图像后要调用的函数.在函数内部,this引用图像元素.
  • onZoomIn (默认值为false):图像放大时要调用的函数.在该函数内部,this引用了图片元素.
  • onZoomOut (默认值为false)*:缩小图像时要调用的函数.在函数内部,this引用图像元素.
  • url - (default value is false) - The url of the large photo to be displayed. If no url is provided, zoom uses the src of the first child IMG element inside the element it is assigned to.
  • on (default value is 'mouseover'): The type of event that triggers zooming. Choose from mouseover, grab, click, or toggle.
  • duration (default value is 120): The fadeIn/fadeOut speed of the large image.
  • target (default value is false): A selector or DOM element that should be used as the parent container for the zoomed image.
  • touch (default value is true): Enables interaction via touch events.
  • magnify (default value is 1): This value is multiplied against the full size of the zoomed image. The default value is 1, meaning the zoomed image should be at 100% of its natural width and height.
  • callback (default value is false): A function to be called when the image has loaded. Inside the function, this references the image element.
  • onZoomIn (default value is false): A function to be called when the image has zoomed in. Inside the function, this references the image element.
  • onZoomOut (default value is false)*: A function to be called when the image has zoomed out. Inside the function, this references the image element.

这篇关于WooCommerce产品图像缩放选项的可用参数详细信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆