Skip to content

Instantly share code, notes, and snippets.

// Website you intended to retrieve for users.
const upstream = 'api.openai.com'
// Custom pathname for the upstream website.
const upstream_path = '/'
// Website you intended to retrieve for users using mobile devices.
const upstream_mobile = upstream
// Countries and regions where you wish to suspend your service.
@whywilson
whywilson / Sticky Product Tabs of WooCommerce.html
Last active February 22, 2022 06:54
Make product tabs sticky to the bottom of header in WooCommerce Store.
<!-- Load the script below after website loaded or in the custom product layout template. -->
<script>
let sticky_element = ".woocommerce-tabs ul.tabs.wc-tabs.product-tabs"
let sticky_element_top = ".woocommerce-tabs.tabbed-content"
let has_adminbar = jQuery("#wpadminbar").length
adminbar_height = has_adminbar == 1 ? jQuery("#wpadminbar").height() : 0
window.addEventListener("scroll", function() {
let header_height = jQuery("#masthead").height() + adminbar_height
let product_tabs_offset_height = jQuery(sticky_element).offset().top - jQuery(document).scrollTop()