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%\');
You can put a check around it that checks the padding-top. If it is not 6%, you need to set it. If it is, you skip the line. Tip: put the result of $('#loadingMessage') in a variable so you do not have to do a second element lookup.
Like so (not tested):
$('#SearchButton').click(function() {
var $loadMsg = $("#loadingMessage");
if($loadMsg.css('padding-top') !== '6%'){
$loadMsg.css('padding-top', '6%');
}
});
This is of course assuming that you want to execute the rest of the code in the click handler every time. Otherwise you can just unbind the click after the handler has been executed. Tip: use the jQuery on() and off() methods instead.