Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WordPress 5 plugin admin js code for the backend preview part of the WH Eyecatcher example project https://wordpress.org/plugins/wh-eyecatcher/
jQuery(document).ready(function( $ ){
jQuery('select#wh_eyecatcher_style').on('change', function () {
$("textarea#wh_eyecatcher_css").val(this.value);
$("div#wh-eyecatcher").attr("style",this.value);
});
jQuery('textarea#wh_eyecatcher_css').on('change keyup paste', function () {
$("div#wh-eyecatcher").attr("style",this.value);
});
jQuery('input#wh_eyecatcher_slogan').on('change keyup paste', function () {
$("div#wh-eyecatcher").html($("input#wh_eyecatcher_slogan").attr("value"));
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment