I’m currently trying to populate a table with thumbnails which point to images in my server and open each in its own window when its clicked.
I can use
echo '<td align="center"><a href="' . $big . $newFile . '" target="_blank"><img src="' . $images . $file . '" /></a></td>';
which works but i want the new window to be resized. I decided to use javascript and i have a script called showImg to show my new window. The thumbnails show but when i mouseover the thumbnails i don’t get the onclick functionality to work. Any leads?
The code below is what i’m trying to work with
echo '<td align="center"><img src="' . $images . $file . '"onclick="showImg(this.src,400,400,"' . $big . $newFile . '");"></td>';
Thanks
Quotes issue. You can’t have double quotes for both the whole onclick and the parameter of the function.
Change the PHP to:
Then in the JavaScript take the image source and thumbnail from the element itself: