I have a table where a cell contains an image, which when clicked will execute a function responsible for opening a box dialog
with the image in big.
<td style="width: 20%;"><?php
$source = $row['T_IMG'];
echo "<img width='50px' height='50px' src=".$source." onclick='maximizeImg()'> ";
?></td>
My question is, if I send maximizeImg(".$source.")
for the function to receive the appropriate image of each row, in the function:
function maximizeImg(){
var table = document.getElementById('tableRelatedTest');
var rCount = table.rows.length;;
//alert(table.rows[rCount - 1].cells[14].innerHTML);
var sourceImg = table.rows[rCount - 1].cells[14].innerHTML;
document.getElementById("imageMax").src = sourceImg;
$(function () {
$("#dialog1").dialog();
$("#dialog1").show();
});
return;
}
How do I pick up or treat that String
in the function so that the image of each row is assigned correctly, that way I could remove the rCount-1
I have indicated.