I have one jquery method and i used call that method on click of a button .
So in that code i have one line " $("#loadingMessage").css('padding-top','6%');
" i need this line execute only once when we call that method first time,later that i gone this line .
So please help me to find one way
the entire method script is below
$('#SearchButton').click(function() {
$(".spinner").css('visibility','hidden');
$("#loadingMessage").css('padding-top','6%'); //I want this line execute only once, i mean first time
loaderStart();
document.getElementById('loadinggif3').style.display = "block";
$("#loadinggif3").show();
$(".col-sm-9").css('visibility','hidden');
var str = $('#SearchText').val();
str = str.trim();
if(str=="") return false;
)};
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…