Close automatically when the user clicks

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 ArchangeDavid 4 years, 8 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #16573
    ArchangeDavid
    ArchangeDavid
    Participant

    (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

    #16589
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi 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 :)


    #16591
    ArchangeDavid
    ArchangeDavid
    Participant

    Hi,

    Thank you for your response

    Unfortunately, the first option is already activated.
    (I disabled the second one)

    • This reply was modified 4 years, 8 months ago by ArchangeDavid ArchangeDavid.
    • This reply was modified 4 years, 8 months ago by ArchangeDavid ArchangeDavid.
    #16594
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    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 :)


    #16597
    ArchangeDavid
    ArchangeDavid
    Participant

    Sorry, 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 4 years, 8 months ago by ArchangeDavid ArchangeDavid.
    #16601
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    You 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 :)


    #16602
    ArchangeDavid
    ArchangeDavid
    Participant

    I just edited the function. php file
    Your code works perfectly.
    Thank you for the clarifications and your vigilance!
    Really great!

    #16603
    ArchangeDavid
    ArchangeDavid
    Participant

    Me 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!

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.