Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Search not working on fixed scroll header
This topic contains 4 replies, has 2 voices, and was last updated by Kaelo Benn 8 years ago.
- AuthorPosts
- December 3, 2015 at 12:14 pm #6888
Good day Support
As mentioned before from our mail through themeforest, we just finished setting up ajax search pro into our new theme for skymartbw.com. We then proceeded to use the plugin STICK MENU, to get our header on fixed position during scroll. Now i have an issue of the search bar not working when it is on a sticky position.
Last but not least, is it possible to highlight or bolden the key word that was typed in search result similar to amazon?
please help.
thank you
kaelobenn
December 3, 2015 at 12:33 pm #6889Hi!
From what I can see the Sticky Menu has an original and cloned container of itself on the same page. I’m guessing it basically uses the clone for when the sreen is scrolling.
There is a huge problem with that approach: it also clones ajax search pro as well. This is never going to work, as the javascript event handlers cannot be cloned. If you put any kind of javascript event driven element to that menu, it’s going to fail, it’s not exclusive to ajax search pro, nothing would work that way.I’ve looked at the code via FTP and the header is cloned via javascript, so there is nothing I can do about it. It is simply impossible to clone html element with the event handlers. Moreover it does not change the element IDs either, so there are multiple elements with the same ID, which is invalid HTML as well.
As a solution I would suggest not using javascript cloning in the header menu, instead simply creating the “clone” HTML in the header.php file and remove the javascript cloning completely. That way the same search shortcode would be used twice and it would work correctly. It’s also much faster and safer, and you would be able to use any kind of element in the header that uses javacript.
- This reply was modified 8 years, 4 months ago by Ernest Marcinko.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 3, 2015 at 2:16 pm #6896Thank you Mr. Marcinko for the insight and your strong suggestion on how to proceed. We will inseminate the sticky plugin completely and hard code the fixed header on scroll (though we are newbies).
regarding the second question, about highlighting or making the keyword searched bold on search results. can this be achieved on a similar format to amazon?
thank you
regards
December 3, 2015 at 4:04 pm #6898Oh, sorry I forgot about the highlighter 🙂
There is a simple keyword highlighter implemented, you can enable it on the Layout Options -> Results Behavior panel: https://i.imgur.com/djOveqW.png
It’s not as clever as the one on amazon, but it should do the trick.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
April 26, 2016 at 9:04 am #8487Thank you
its working wonderfully well.
- AuthorPosts
The topic ‘Search not working on fixed scroll header’ is closed to new replies.