I have a list of categories in a database that our echoed onto the page like so:
echo '<li><a href=#?id='.$row['category_id'] .' "> ' . $row['category_name'] . '</a></li>';
How would I echo that corresponding image(category_image) that is in the database when I hover over these links individually?
Do I hide a div and then have it appear on hover with the image inside? but then how do I transfer the id?
category_image is a path, not the actual image.
Just output the image as well, hide it via CSS and show it on hover. No need to make a roundtrip to the server to fetch anything. ;-)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.