1
My problem is this: I have a page where I must select an image to be displayed on the screen. These images are in a specific directory that will stay on the server. Currently, I am calling the images randomly and displaying on the screen, however, I want to call these images in a way that opens a window displaying the images from that directory so that I can choose the image and click on the screen. The code of the js page is these:
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<h1 class="page-header">
<table width="400px" border="0">
<tr>
<td>
<input type="image" name="selectImage" src="../layout/imagens/Abrir.png" onClick="image()">
</td>
</tr>
</table>
</h1>
<div id="image"></div>
The js:
function image() {
global_points = new Array();
global_effects = new Array();
random = Math.floor(Math.random() * (17 - 1) + 1);
img = new Image();
img.src = "../radiografias/" + random + ".jpg";
document.getElementById('image').innerHTML = "<img style=\"
cursor:crosshair\" id='logo' href=\"#\" onmousedown= \"coordenadas(event)\"
src=\"" +
img.src + "\" width= 1050 />";
reset();
}
If anyone can help me, I’d really appreciate it.
Do the images have a name in sequence? Which would be?
– Sam
Image names are numerical, in my case they go from 1 to 17...
– Abel Galvão
Vc uses PHP?....
– Sam
Usage tbm.........
– Abel Galvão
Blz... I’m posting the answer right now.
– Sam