HTML jquery buttons sometimes don't react

Spadow

New Member
Hi I have a few simple buttons which sometimes don't react. It happens rarely but I still don't like it. It happens more if you click very fast or change the navigation very very fast. This is the code I have for them :\[code\]$(document).ready(function () { $('[id*=txt]').hide(); $('[id*=hd]').hide(); $('[id*=home]').show(); $('#btnhome').css('background-color',"#555"); $('#btnhome').css('opacity',"0.4"); $('.button').click(function (){ $('[id*=txt]').hide(); $('[id*=hd]').hide(); $('.button').css('background',"transparent"); $('.button').css('opacity',"1"); $(this).css('background-color',"#555"); $(this).css('opacity',"0.4"); }); $('#btnhome').click(function () { $('[id*=home]').show(); }); $('#btnabout').click(function () { $('[id*=about]').show(); }); $('#btncontact').click(function () { $('[id*=contact]').show(); });});\[/code\]They are only used for showing and hiding the text and they also change the color opacity and so on when they are clicked. When they don't react nothing happens at all, as if I don't have any click function defined.DEMO^This is what I'm basically using, try hitting them in a random order and switching in a fast way (happens more if you do it fast). You'll see that sometimes they don't react. Its a little bit harder to notice because it happens rarely (sometimes more often) so it wont probably happen at first but it sure happens. So give it a try a good few times and you'll see what I'm talking about. The more fast and random you do it the more it will happen.
 
Back
Top