1
I’m setting up a school website, and I’m adopting a new resource. I created an input file for people to insert images and they, through a preview should trim in the respective frames below. But it only works with the first frame! does not fall on the other three.
This is the link you can see and understand: http://escolacem.com.br/painel/index-bilhete.php
My code is as follows:
Javascript:
<script type="text/javascript">
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#blah')
.attr('src', e.target.result)
};
reader.readAsDataURL(input.files[0]);
}
}
</script>
HTML:
<input type='file' onchange="readURL(this);" /> <img id="blah" class="largura" />
How do I make the image appear more often in other frames?
How’s that area of the paintings?
$('#blah')
 .attr
suggests only one element.– BrTkCa
Voce is only taking the first file
input.files[0]
- recalling that theid
of theirimg
should be unique. then Voce could addblah
as a class and select images by classblah
– andrepaulo