HTML jquery Buttons sometimes not reacting

vBulle

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\]These are the buttons :\[code\]<button class="button" id="btnhome">Home</button> <button class="button" id="btnabout">About</button><button class="button" id="btncontact">Contact</button>\[/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.
 
Back
Top