Below is part of the code I use to display multiple rows of products with tiny thumbnails (35x35 pixels) next to each product. It is an admin page that I created, much like a spreadsheet for managing products, so the less space they take up the better.
Everything works great, but I would like to have the client "mouseover" to view a larger image. I understand how to do "onmouseover" and/or work with CSS to achieve enlargement of the image, but usually that's with a traditional <img src... >
element.
Is it even possible to alter or tap into wp_get_attachment_image to do the same effect? I can't simply paste code into the <img>
element because its "not there", so to speak, to type into (sorry for my lack of terminology, but I assume this is a function rather than static code I can work with).
Or, is there a way to NOT set the array(35,35) and just make the <li>
a certain size container, make the image fill that container, and work with that element to do the image alteration?
if ( $attachments ) {
foreach ( $attachments as $attachment ) {
$thumbimg = wp_get_attachment_image( $attachment->ID, array(35,35) );
$productlist .= '<li style="display: inline-block; vertical-align: top; margin: 0px; margin-right: 7px;">' . $thumbimg . '</li>';
}
}