CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Mouseover event - Not working with database image

Print topic Send  topic

Author Message
Shnokey

Posts: 7
Posted: 04/22/2004, 2:52 AM

Here is the code for a STATIC image:


<html>
<head>
<title></title>
<script type="text/javascript">

//Specify image paths and optional link (set link to "" for no link):
var dynimages=new Array()
dynimages[0]=["photo1.jpg", ""]
dynimages[1]=["photo2.jpg", ""]
dynimages[2]=["photo3.jpg", ""]

//Preload images ("yes" or "no"):
var preloadimg="no"

//Set optional link target to be added to all images with a link:
var optlinktarget=""

//Set image border width
var imgborderwidth=0

//Optionally, change 1.0 and 0.7 below to affect Wipe gradient size and duration in seconds in IE5.5+:
var filterstring="progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.7)"

if (preloadimg=="yes"){
for (x=0; x<dynimages.length; x++){
var myimage=new Image()
myimage.src=dynimages[x][0]
}
}

function returnimgcode(theimg){
var imghtml=""
if (theimg[1]!="")
imghtml='<a href="'+theimg[1]+'" target="'+optlinktarget+'">'
imghtml+='<img src="'+theimg[0]+'" border="'+imgborderwidth+'">'
if (theimg[1]!="")
imghtml+='</a>'
return imghtml
}

function modifyimage(loadarea, imgindex){
if (document.getElementById){
var imgobj=document.getElementById(loadarea)
if (imgobj.filters && window.createPopup){
imgobj.style.filter=filterstring
imgobj.filters[0].Apply()
}
imgobj.innerHTML=returnimgcode(dynimages[imgindex])
if (imgobj.filters && window.createPopup)
imgobj.filters[0].Play()
return false
}
}

</script>
</head>

<body>

<table border="0" cellspacing="0" cellpadding="0">
<tr><td colspan=5 align=center><div id="dynloadarea" style="width:50px;height:225px"><img border="0" src="photo1.jpg"></div></td></tr>
<tr><td colspan=5 height=5 width=1> </td></tr>
<tr>
<td><a href="#" onMouseover="modifyimage('dynloadarea', 0)"><img border="0" src="photo1.jpg" width="50" height="50" style="margin-bottom: 5px"></a></td>
<td width=5> </td>
<td><a href="#" onMouseover="modifyimage('dynloadarea', 1)"><img border="0" src="photo2.jpg" width="50" height="50" style="margin-bottom: 5px"></a></td>
<td width=5> </td>
<td><a href="#" onMouseover="modifyimage('dynloadarea', 2)"><img border="0" src="photo3.jpg" width="50" height="50" style="margin-bottom: 5px"></a></td>
</tr>
</table>

</body>
</html>


works great - now when I reference an image from the database:

"{image_url1}" in place of "photo1.jpg" - it does not work -

any ideas?

Thanks
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.