KOMPOOS.NL

highlight image

home » javascripts » image-effects » highlight-image.html

sitemap


demo highlight image

highlight image

handleiding highlight images

Plaats het onderstaande javascript zo laag mogelijk in de body-sectie van jouw pagina. Het script zorgt er nu voor dat alle plaatjes op de pagina zullen "oplichten" als er erover "ge-hoverd" wordt.

highlight image script


<script>
var de_css_code = 'img,a:visited img,a img{border:0;-moz-opacity:0.3;'+
    'opacity:0.3;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";'+
    'filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=30);opacity:.3;-khtml-opacity:0.3;}'+
    'img:hover,a:hover img{-moz-opacity:1.0;opacity:1.0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";'+
    'filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100);opacity:1;-khtml-opacity:1.0;}',
stijl_element = document.createElement("style");
stijl_element.type = "text/css";
if (stijl_element.styleSheet) {
    stijl_element.styleSheet.cssText = de_css_code;
} else {
    stijl_element.appendChild(document.createTextNode(de_css_code));
}
document.getElementsByTagName("head")[0].appendChild(stijl_element);
</script>
Gebruik voor alle voorbeelden op de http://kompoos.nl een valide html5 pagina.