javascript - jQuery .css not working? -
i have webpage tabs, want tabs hidden default , shown when login has been completed (on successful login function run in js, can't seem show tab function).
i have tried several methods, such as: - tab hidden default (with "display:none" in html), , using .css("display","inline-block"); show it. - tab hidden in document load .css("display","none"); , shown later .css("display","inline-block"); - tab hidden in document load .hide(); , shown .show();
however none of them work, tab shows. part of code relates this:
document load method:
$(window).load( function() { $("addeventtab").css("display","none"); $(".loader").fadeout("slow"); } }
login success function:
if (parseint(response.substr(7,1)) >= 5) { $("addeventtab").css("display" , "inline-block"); alert("appearing"); }
html code tab:
<li role="presentation" id="addeventtab"> <a href="#eventadd" aria-controls="eventadd" role="tab" data-toggle="tab"> <i class="fa fa-plus fa-1x">add event</i> </a> </li>
you missing #
i.e. id selector of addeventtab
:
$("#addeventtab").css("display","none");
Comments
Post a Comment