Dear All,
Is there a way to run a code depending the breakpoints?
For example:
export function button1_click(event) { if breakpoint is greater than 1001 { do this code#1 } else if breakpoint is between 751 and 1000 { do this code#2 } else if breakpoint is smaller than 750 { do this code#3 } }
Thank you for your help.
Best regards,
Domivax
Hi @domivax
This is a great suggestion and is something that we plan on implementing in the future.
Currently, it is possible to run code on a specific screen size ranges, by using the "wix-window" api.
You can get the current screen size and create a logic for when to run the code.
More info: https://www.wix.com/corvid/new-reference/wix-window/getboundingrect
Please let us know if you have questions.
For specific questions regarding writing the code we recommend that you contact our Corvid experts at https://www.wix.com/corvid/forum
Thank you @Sebi for your reply.
getBoundingRect works very well. Below my final code.
Best regards,
Domivax
Great! Thanks for sharing the code!