Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Close automatically when the user clicks
This topic contains 7 replies, has 2 voices, and was last updated by ArchangeDavid 6 years, 7 months ago.
- AuthorPosts
- January 31, 2018 at 6:01 pm #16573
(Sorry, Google translate)
Hi,
I searched but I couldn’t find…
How do I make the search engine close automatically when the user clicks elsewhere on the page?
I would like to take this opportunity to point out something strange
I have observed that after using the search engine and changing pages, it sometimes happens that the results window is displayed again (on the left side of the screen) without any action on my part. If you have any idea what the problem is, I’ll take it.Thx
David
February 1, 2018 at 10:14 am #16589Hi David,
To close the results on document click, just enable this option here: https://i.imgur.com/hoV56db.png
If the search window opens after the browser back button, then make sure that this feature is disabled: https://i.imgur.com/mqhhpyN.png
These should do the trick.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
February 1, 2018 at 10:59 am #16591Hi,
Thank you for your response
Unfortunately, the first option is already activated.
(I disabled the second one)- This reply was modified 6 years, 7 months ago by ArchangeDavid.
- This reply was modified 6 years, 7 months ago by ArchangeDavid.
February 1, 2018 at 11:05 am #16594Hi,
You mean to close the search area when clicking on the page?
Well, that is not part of the search plugin, it is some sort of custom script, but I might be able to suggest something.
Add this custom code to the functions.php in your theme/child theme directory (copy from line 3 only!). Before editing, please make sure to have a full site back-up just in case!Please note that this is not related to the plugin, so it may not work correctly in every case.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
February 1, 2018 at 11:18 am #16597Sorry, Google Translate
Thank you for your help
I had several people test the site and they don’t know how to make the search results disappear. Similarly, they do not know how to remove the search area. which opens when you want to start the search.
I just tested the code you gave me.
It works fine but only closes results and not the search engine.
It’s vegan.It would probably be great if the plugin included automatic closing of the search area and results when the user clicks on the page.
I think that would please everyone and would be widely used.
- This reply was modified 6 years, 7 months ago by ArchangeDavid.
February 1, 2018 at 11:37 am #16601You are welcome.
Please note that the search area in this case is not controlled by the plugin, so I cannot make a solution to simply close it. The search area is defined by the theme, as well as the button to open it. Unfortunately it would be the themes responsibility to have this feature.
The code is not corretly placed on the page, you have put it into the custom CSS section, that is not correct. You have to use it in the functions.php file in the theme directory, otherwise it won’t work. Do you need help with that?
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
February 1, 2018 at 11:44 am #16602I just edited the function. php file
Your code works perfectly.
Thank you for the clarifications and your vigilance!
Really great!February 1, 2018 at 11:46 am #16603Me again!
Your code allows you to close the entire search area, including the bar.
it’s PERFECT!I think this option will interest your customers; -)
Thank you again!
- AuthorPosts
You must be logged in to reply to this topic.