Skip to content

Instantly share code, notes, and snippets.

@WordPress-Handbuch
Created March 27, 2019 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WordPress-Handbuch/8ff4952f5d80069fe66a3dc485a4b67a to your computer and use it in GitHub Desktop.
Save WordPress-Handbuch/8ff4952f5d80069fe66a3dc485a4b67a to your computer and use it in GitHub Desktop.
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