005_TF_The-Livepreview-ParameterThe livepreview parameter is available to most of the options. This setting / parameter only takes effect when the option is placed inside a theme customizer section and is used to update the looks of the site whenever the option is changed.

The livepreview parameter is optional. Your live preview will still refresh everytime an option is changed, but it will take a longer time to do so since the whole frame will be reloaded by your browser. When this parameter is used, jQuery will be used to quickly update the looks of the site.

The value inside the livepreview parameter is a jQuery snippet used to update elements in your theme

A Quick Example

Here’s a quick example of an option that will update the background color of the body element:

In the example above, when the option value is changed in the theme customizer, your browser runs the code:

The framework automatically assigns the selected value for the option in the value variable. Then executes the code set in the livepreview parameter.

[zilla_alert]Remember, only some options have this parameter.[/zilla_alert]

Leave a Reply