script © 2013 by webdesign weisshart |
Bei Bildklick erscheint Rahmen |
So sieht´s aus |
![]() |
Quellcode |
<html>
<head> <style type="text/css">Hier nichts</style> </head> <body > <img alt="" height="250" src="../Bilder/Andie%20MacDowell.jpg" width="200" > <script> var imgProp = { 'padding': '30px', 'backgroundColor': 'green', 'borderSize': '10px', 'borderStyle': 'dashed', 'borderColor': 'fuchsia'}; function highlightImg() { var allimgs = document.getElementsByTagName('img'); var nrallimgs = allimgs.length; for(i=0; i<nrallimgs; i++) { allimgs[i].onclick=function() { if(this.style.borderStyle == imgProp.borderStyle) { this.style.padding = 'auto'; this.style.background = 'none'; this.style.border = 'none'; } else { this.style.padding = imgProp.padding; this.style.backgroundColor = imgProp.backgroundColor; this.style.borderSize = imgProp.borderSize; this.style.borderStyle = imgProp.borderStyle; this.style.borderColor = imgProp.borderColor; } } } } highlightImg(); </script> </body> </html> |
Kontakt Datenschutz Impressum |
|