Issue with javascript
-
I have a question, I created a widget here a little snippet.
$slides_to_show = range( 1, 3 );
$this->add_responsive_control(
‘slides_to_show’,
[
‘label’ => __( ‘Slides to Show’, ‘elementor’ ),
‘type’ => Controls_Manager::SELECT,
‘options’ => [
” => __( ‘Default’, ‘elementor’ ),
] + $slides_to_show,
‘frontend_available’ => true,
]
);
I would like to use the $slides_to_show variable in my javascript code like this.
$(‘.owl-screenshot’).owlCarousel({
loop:true,
responsive:{
1000:{
items:$slides_to_show
}
}
})
How is it possible to use the $slides_to_show in my js file? Can’t find a solution hopefully you can give me a tip.
- The topic ‘Issue with javascript’ is closed to new replies.