Site icon Hip-Hop Website Design and Development

Looking for a way to load a function after customizer preview refresh complete

I need to load a callback function after a wp.customize.previewer.refresh(). I need this because I want to update a template position which is displayed with a custom hook in my theme and scroll the preview frame on the new template position.

I use wp.customize.previewer.bind('synced', ...) but every time I change the position on my control, this bind event calls itself as many times as I change the position. So after the first position update on my control, the bind event calls itself once, but the second update calls the bind event twice and so on…

For your information I use WordPress 4.7.