Relative Content

Tag Archive for javascriptwordpresselementor

Javascript not work properly in Loop Grid widget(Elementor Pro)

So, i have a loop item template, where among other things, there is a button widget(with no click on it, used just for shape and easy to use) that fetch a custom field value from the post. This value is a number between 0-100. The button is accompanied by a script that change the color of the button based on the value in it.

Loading/playing two separate videos with two different buttons

I have two videos embedded on a WordPress site built in Elementor. Each button hides an image and reveals a video embed. Button 1 needs to play Video 1, Button 2 needs to play Video 2, etc. Right now, both buttons play Video 1 because the videos are accessed via querySelectorAll which I know stores them as an array. What I can’t figure out is how to iterate through them so each button plays its respective video.