Custom code at different breakpoints?

Hi Guys,

Can anyone tell me how to run custom code at different breakpoints? (manually without Weblow interactions)

For example, the below script sets a buttons state to active when clicked.

<script>
$('.game-top-level').on('click', function(){
 	$('.game-top-level').removeClass('active-item')
	$(this).addClass('active-item')
 });
</script>

It works great and on Desktop.
I would however like to run a different script for tablet and mobile sizes.

Webflow has this UI for it below, but I would like to do the same with code.

trigger-settings

Any help would be much appreciated!
Thank you!

The best wat is to use the Window.matchMedia method in JS. See => Window.matchMedia() - Web APIs | MDN

Thanks for the reply! I also found this

Run different scripts on desktop vs mobile

Run different functions on desktop vs mobile

Checking them all out as we speak :slight_smile: