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.

, Emilien Laborde 6 years 2016-12-09T15:02:09-05:00 0 Answers 89 views 0

Leave an answer