I have set up a little template with a basic header. I am trying to make something similar to a drag and drop website building, but in this case the layout will be the same, just the content changes.
As I say, I have created a header element and given it a background image
header {
width: 100%;
height: 200px;
background: url(https://pearsonified.com/theme/neoclassical/wp-content/themes/neoclassical/headers/header_2.jpg) center center no-repeat;
background-size: cover;
}
To get the image to change on click, I could do something like this
$(function() {
$('#header').click(function() {
$(this).css('background', 'url(https://pearsonified.com/theme/neoclassical/wp-content/themes/neoclassical/headers/header_1.jpg)');
});
});
I have set up an example JSFiddle. Although this is similar to what I want to do, instead of changing to a hardcoded image, I want to allow the user to select the image from their computer. So a bit like an image upload select option, but in this case I am not uploading anything. My aim on completion is to have a save button, that will generate the HTML/CSS files for these updates.
So I was wondering how would I go about allowing the user to choose what image they want to replace the default with?
Thanks