Hello All,
I'm trying to create function, that after clicking on button, will open my search box, and after clicking again on this same button it will close it.
I have build this:
$("#searchbutton").click(function(){
$("#searchBox").animate({top: '0px'}, 500),
$(this).click(function(){
$("#searchBox").animate({top: '-47px'}, 500)
});
});
It works fine but only first time after i click on it. Then if I'll click on it again to re-open without refreshing the page button will automatically hide.
Why is it happening?
Thank you for your help in advance
Dom