Home Advanced Code Highlight Image

Highlight Image

E-mail Print PDF

This script will turn your image to grey and then when you hover over it with your cursor it will turn back to it's color.

Place this code into the head of your page:

Code:
<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.MozOpacity)+0.1
 
else if (cur2.filters&&cur2.filters.alpha.opacity<100)
 
cur2.filters.alpha.opacity+=10
 
else if (window.highlighting)
 
clearInterval(highlighting)
 }
 
 
</script> 
Use this code to link up your images. Just change the domain to your's and the file name to that of your image and change the path to that of your image as well:

Code:
<img src="http://www.domain.pathtoyourimage.filename" style="filter:alpha(opacity=30);-moz-opacity:0.3" onMouseover="high(this)" onMouseout="low(this)"

 

Domain Names

Sample image .com .info
.mobi .net
.org .tv .us
.biz .ws .name
.am .at .be .cc .cn .de .eu
.fm .jobs .jp .ms .nu .nz
.tc .tw .uk .vg .ASIA .ME

Website Hosting

Sample image We're the affordable, reliable place to host your site. And unlike the competition, there's no set up fee and no annual commitment.

24/7 Support

Sample image Our highly trained, courteous support staff is waiting to help. We'll resolve any issue to your complete satisfaction.