Trying to have original image hover a little larger copy of itself. When I used picture with "this.src=imgURL"
I had no problem, adding Javascript/css made a permanent after image on website and I want this to apply several pictures not just 1. With the css it only apply to one picture in that certain spot. I tried using Javascript to create a loop for every picture, but I am completely stuck right now, can anyone help with some guidance?
function hideImage() {
document.getElementById("full").src = "";
}
function showImage(img) {
var src = img.src;
var largeSrc = src.replace('small', 'large');
document.getElementById('full').src = largeSrc;
}
var images = document.querySelectorAll('.thumbnail');
for(var i = 0; i < images.length; ++i) {
var image = images[i];
console.log(image.src); // output: image1.jpg, image2.jpg, image3.jpg
}
#full {
position: absolute;
width: 100px;
height: 100px;
display:block;
top: 200px; left:170px;
border: 10px solid rgb(255, 255, 255);
outline: 1px solid black;
margin: 10px
}
<td><input type="checkbox" name="index[]" value="10" /></td>
<td><img onmouseover="showImage(this)" onmouseout="hideImage()" src="images/art/thumbs/05030.jpg" class="thumbnail" /></td>
<span><img id="full" /></span>