Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
254 views
in Technique[技术] by (71.8m points)

Elementor widget SELECT change

I have SELECT element in backend in my elementor widget. IS it possible when SELECT skin changes, to set color in playerBgColor element somehow from $skin_colors array? Or if this cannot be done with php, can this be done with javascript? Again, these are settings for the widget in backend in _register_controls.

$skin_colors = array(
    "light" => array(
        "playerBgColor" => "#ffffff",
        "playerAccent" => "#d24de9"
    ),
    "dark" => array(
        "playerBgColor" => "#1b1b1b",
        "playerAccent" => "#e91e63"
    )
);

$this->add_control(
    'skin',
    [
        'label' => __( 'Choose skin', 'elementor-brona' ),
        'type' => ElementorControls_Manager::SELECT,
        'options' => [
            'light' => esc_html__( 'Light', 'elementor-brona' ),
            'dark' => esc_html__( 'Dark', 'elementor-brona' ),
        ],
        'default' => 'light',
    ]
);

$this->add_control(
    'playerBgColor',
    [
        'label' => esc_html__( 'Player background color', 'elementor-brona' ),
        'type' => ElementorControls_Manager::COLOR,
        'scheme' => [
          'type' => ElementorScheme_Color::get_type(),
          'value' => ElementorScheme_Color::COLOR_1,
        ],
        'alpha' => false,
        'default' => ''
      
    ]
);
question from:https://stackoverflow.com/questions/65846919/elementor-widget-select-change

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...