View Full Version : Mouse-over image script
Razor
04-05-2008, 08:48 PM
Does anyone know where I might find a script to give you a preview of a thumbnail image when the cursor is held above it? I've found the ones that you have to click the image but I can't use that.
There is an example on templatemonster.com (http://templatemonster.com) but I can't find the script for it.
Thanks in advance for any help.
Razor
http://www.dynamicdrive.com/style/csslibrary/item/css-popup-image-viewer/P170/
matthewbluewars
04-05-2008, 10:22 PM
Make the onmouseover "preview(image1)" and id "image1". Then add this code:
<script type="text/javascript">
function preview(id) {
//Set the height of the preview
var height = 100;
document.getElementById(id).style.height= height;
}
</script>You can reuse this code on different images as long as you change the preview() function's id argument to the id of the image affected.
Razor
04-06-2008, 01:07 AM
Make the onmouseover "preview(image1)" and id "image1". Then add this code:
<script type="text/javascript">
function preview(id) {
//Set the height of the preview
var height = 100;
document.getElementById(id).style.height= height;
}
</script>You can reuse this code on different images as long as you change the preview() function's id argument to the id of the image affected.
Cool, thanks for the help guys, works great!
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.