久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

在woocommerce 3中調整產品圖像的縮放倍率

Adjusting product image#39;s Zoom magnification factor in woocommerce 3(在woocommerce 3中調整產品圖像的縮放倍率)
本文介紹了在woocommerce 3中調整產品圖像的縮放倍率的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我正在使用 Storefront 主題,并且一直想知道是否有辦法在將鼠標懸停在產品圖像上時調整其縮放級別.

解決方案

這可以使用 woocommerce_single_product_zoom_options 專用過濾器鉤子實現.

<塊引用>

選項數組中的鉤子未記錄的可用參數是:

<塊引用>

$zoom_options = 數組 (

 'url' =>錯誤的,'回調' =>錯誤的,'目標' =>錯誤的,'持續時間' =>120,//以毫秒為單位的轉換(默認為 120)'上' =>'mouseover',//其他選項:抓取、點擊、切換(默認為鼠標懸停)'觸摸' =>true,//啟用觸摸回退'onZoomIn' =>錯誤的,'onZoomOut' =>錯誤的,'放大' =>1,//縮放倍率:(默認為 1 | 0 到 1 之間的浮點數));

相關:

放大倍數設置為 0.7 之前:

I'm using the Storefront theme and have been wondering if there is a way to adjust the zooming level imposed on the product image upon hovering on it.

解決方案

This is possible using woocommerce_single_product_zoom_options dedicated filter hook.

The hook undocumented available parameters in the options array are:

$zoom_options = array (

    'url' => false,
    'callback' => false,
    'target' => false,
    'duration' => 120, // Transition in milli seconds (default is 120)
    'on' => 'mouseover', // other options: grab, click, toggle (default is mouseover)
    'touch' => true, // enables a touch fallback
    'onZoomIn' => false,
    'onZoomOut' => false,
    'magnify' => 1, // Zoom magnification: (default is 1  |  float number between 0 and 1)
);

Related: Available parameters details for WooCommerce product image zoom options

Usage with woocommerce_single_product_zoom_options filter hook to change the magnification level (for example we mill minimize the zoom level a bit less):

add_filter( 'woocommerce_single_product_zoom_options', 'custom_single_product_zoom_options' );
function custom_single_product_zoom_options( $zoom_options ) {
    // Changing the magnification level:
    $zoom_options['magnify'] = 0.7;

    return $zoom_options;
}

Code goes in functions.php file of your active child theme (or active theme). Tested and work.

Before with default magnification (set to 1):

Before with magnification set to 0.7:

這篇關于在woocommerce 3中調整產品圖像的縮放倍率的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Add programmatically a downloadable file to Woocommerce products(以編程方式將可下載文件添加到 Woocommerce 產品)
Get today#39;s total orders count for each product in Woocommerce(獲取今天 Woocommerce 中每種產品的總訂單數)
Add Custom registration fields in WooCommerce and phone field validation issue(在 WooCommerce 和電話字段驗證問題中添加自定義注冊字段)
Add a select field that will change price in Woocommerce simple products(在 Woocommerce 簡單產品中添加一個將更改價格的選擇字段)
Add custom columns to admin products list in WooCommerce 3(在 WooCommerce 3 中將自定義列添加到管理產品列表)
Customizing checkout quot;Place Orderquot; button output html(自定義結帳“下訂單按鈕輸出html)
主站蜘蛛池模板: 美女天堂在线 | 一级做a爰片性色毛片视频停止 | 激情网站在线观看 | 中文字幕在线三区 | 久久久久久久一区二区 | 国产精品影视在线观看 | 欧美一区视频 | 中文字幕日韩欧美 | 欧美中文字幕一区二区 | 日日草夜夜草 | 欧美视频二区 | 国产精品久久福利 | 欧美日韩国产精品 | 美女爽到呻吟久久久久 | 久久久久久成人 | 亚洲色图在线观看 | 国产ts人妖系列高潮 | 国产高清一区二区三区 | 久久国产精品偷 | 欧美综合视频 | 亚洲美女网站 | 欧美日韩精品一区二区三区视频 | 一级黄色绿像片 | 国产精品69毛片高清亚洲 | h在线免费观看 | 国产精品99久 | 激情av免费看 | 日韩精品一区二区三区免费观看 | 亚洲成人av一区二区 | 一区二区三区国产精品 | 欧美视频精品 | 一区二区三区韩国 | 欧美日韩在线综合 | 欧美黄色一级毛片 | 国产精品成人一区二区三区 | 999精品在线 | 在线观看特色大片免费网站 | 粉嫩粉嫩芽的虎白女18在线视频 | 91久久伊人 | 成人日韩 | 免费一区二区 |