Hi, first post here, and I’m probably being stupid, but oh well.
I have this extremely simple javascript, which works in one order but when reversed it stops.
This works.
<script type=”text/javascript”>
function setOpaque(){
document.getElementById(‘panelayer’).style.opacity+=document.getElementById(‘panelayer’).style.opacity-.1;
}
</script>
</head>
<body onclick=”setOpaque();”>
<div id=”panelayer” style=”opacity:1;”>
layer layer layer layer layer
</div>
This does not work.
<script type=”text/javascript”>
function setOpaque(){
document.getElementById(‘panelayer’).style.opacity+=document.getElementById(‘panelayer’).style.opacity+.1;
}
</script>
</head>
<body onclick=”setOpaque();”>
<div id=”panelayer” style=”opacity:0;”>
layer layer layer layer layer
</div>
The first one repeatedly decreases the opacity of the text each time you click on the background, while the second sets the opacity of the layer to 0.1 and never changes it after that.
By the bye, please disregard that the only method of changing opacity is through the opacity style, I was just testing this using the Safari browser, once I actually put it to use I will add the mozilla and IE compatable tags as well.
Thanks in advance…