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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…