HOLY ****! I registered in this forum just to post this:
RANGANA THANK YOU FOR THOSE PRECIOUS JS LINES! FCK YEAH!!!!
So simple and so evident, maybe that's why I couldn't find this anywhere! xD
I adapted to my case (increase the opacity of the button):
HTML Code:
<script type="text/javascript">
window.onload = function()
{
var image1 = document.getElementById('male');
var image2 = document.getElementById('female');
image1.onclick=function(){reset();this.style.opacity='1';
this.style.filter="alpha(opacity=100)";}
image2.onclick=function(){reset();this.style.opacity='1';
this.style.filter="alpha(opacity=100)";}
}
function reset(){
var image1 = document.getElementById('male');
var image2 = document.getElementById('female');
image1.style.opacity="0.4";image1.style.filter="alpha(opacity=40)";
image2.style.opacity="0.4";image2.style.filter="alpha(opacity=40)";}
</script>
And it just goes like this:
HTML Code:
<div>
<ul>
<li class="gender_button" id="male">Male</li>
<li class="gender_button" id="female">Female</li>
</ul>
</div>
Where gender_button is in a css referencing a background image!
Bookmarks