Một số thủ thuật cho Elementor

Tăng thêm khoảng cách khi cuộn đến vị trí nào đó, đặc biệt khi dùng sticky header

$( window ).on( 'elementor/frontend/init', function() {
     var headerheight = $("#sticky-header").outerHeight() || 30;
     elementorFrontend.hooks.addFilter( 'frontend/handlers/menu_anchor/scroll_top_distance', function( scrollTop ) {
          return scrollTop - headerheight;
     } );
} );

Hoặc chèn đoạn css này:

:target {
    scroll-margin-top: 100px;
}

Tự động chèn dữ liệu vào các thẻ “tùy chọn” trong Elementor Form


add_filter('elementor_pro/forms/render/item/checkbox', function( $item, $index, $form ) {
    if ( 'Contact Form' === $form->get_settings_for_display( 'form_name' ) ) {
        if ( 'f0033ec' === $item['_id'] ) { // Types
            $item['field_options'] = "Red|red\nGreen|green\nBlue|blue";
        }
    }
    return $item;
}, 10, 3 );
Theo dõi
Thông báo của
guest
0 Comments
Cũ nhất
Mới nhất Được bỏ phiếu nhiều nhất
Phản hồi nội tuyến
Xem tất cả bình luận
0
Rất thích suy nghĩ của bạn, hãy bình luận.x