Copy link to clipboard
Copied
Right so i have this HTML code that I can embed into Muse which is -
<input type="file" accept="image/*" onchange="loadFile(event)">
<img id="output" />
<script>
var loadFile = function(event) {
var reader = new FileReader();
reader.onload = function() {
var output = document.getElementById('output');
output.src = reader.result;
};
reader.readAsDataURL(event.target.files[0]);
};
</script>
This code allows me to preview files but how do I add what width and height I want the file to be previewed at? Please help, many thanks!
Copy link to clipboard
Copied
I imagine you could use CSS to define the height & width of your #output selector.
CSS:
#output {
/**adjust numeric values in px as desired**/
height: xxxpx;
width: xxxpx;
}
HTML:
<img id="output" />
result comes out here...
</div>
Copy link to clipboard
Copied
Im adding this code into Adobe Muse which allows you to insert HTML but not CSS, is there any other way about this?
Copy link to clipboard
Copied
You add the CSS in the page properties in the Meta data section for <head> code.
You would add:
<style>
#output {
/**adjust numeric values in px as desired**/
height: xxxpx;
width: xxxpx;
}
</style>
Copy link to clipboard
Copied
Its okay I've found the solution, thank you for your help