View Full Version : transparent image


Tracey
04-19-2005, 08:55 PM
I been looking for the transparent image code. I don't want the background of the images to have one regular color, but an image. Could anyone help?

Chris
04-19-2005, 08:59 PM
I don't quite understand what you mean, but you can't make an image transparent with a code. You need an image program for that.

netaholic
04-19-2005, 09:06 PM
put this between your head tags


<script language="JavaScript1.2">

//Gradual-Highlight image script- By Dynamic Drive
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
//This credit MUST stay intact for use

function high(which2){
theobject=which2
highlighting=setInterval("highlightit(theobject)",50)
}
function low(which2){
clearInterval(highlighting)
if (which2.style.MozOpacity)
which2.style.MozOpacity=0.3
else if (which2.filters)
which2.filters.alpha.opacity=30
}

function highlightit(cur2){
if (cur2.style.MozOpacity<1)
cur2.style.MozOpacity=parseFloat(cur2.style.MozOpa city)+0.1
else if (cur2.filters&&cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (window.highlighting)
clearInterval(highlighting)
}

</script>



...and this in the image tag


style="filter:alpha(opacity=30);-moz-opacity:0.3" onMouseover="high(this)" onMouseout="low(this)">



Is that what you wanted?

Tracey
04-19-2005, 09:25 PM
I don't quite understand what you mean, but you can't make an image transparent with a code. You need an image program for that.
Alright, thanks.

Netaholic: Sorry but that;s not what I really wanted, that script is to fade images when not on mouseover. I wanted a transparent image, but I need an image program.

Thanks to both of you,
Tracey

Chris
04-20-2005, 09:50 PM
Thanks to both of you,
Tracey
You're welcome :)

Chris