Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Disable Ajax load
- This topic has 11 replies, 2 voices, and was last updated 10 years, 4 months ago by
Alexander Vinnik.
-
AuthorPosts
-
January 27, 2016 at 7:35 pm #7453
Alexander Vinnik
ParticipantHello
I need:
– when user click on “try this” keyword it redirects right to search results page;
– when user enters some keyword in search filed and click “Enter” or on “Search icon” it opens a search results page;How to do this?;
January 28, 2016 at 9:05 am #7457Ernest Marcinko
KeymasterHi!
2. You can enable that on the General Options -> Behavior panel: http://i.imgur.com/rUaziJ7.png
1. There is no option to redirect the “try this” keywords to the results page, however you can use this code snippet, if you have the option above enabled:
[html]<script>
var _scope = ASP.getScope();
_scope(function($) {
$("p.asp-try a").click(function(){
setTimeout(function(){
var e = $.Event( "keyup", { which: 13 } );
$("input.orig").trigger(e);
}, 400);
});
});
</script>[/html]You can put this in your active themes folder, into the footer.php file, just before the closing body tag.
January 29, 2016 at 6:09 pm #7488Alexander Vinnik
ParticipantThanks,
How to make it work on mobile version as it works only on desktop version?February 1, 2016 at 11:17 am #7503Ernest Marcinko
KeymasterHi!
Maybe try to change the script to:
[html]<script>
var _scope = ASP.getScope();
_scope(function($) {
$("p.asp-try a").click(function(){
setTimeout(function(){
$("div.promagnifier").click();
}, 400);
});
});
</script>[/html]February 1, 2016 at 3:46 pm #7516Alexander Vinnik
ParticipantIt helped, thanks!
Another question, how to change the font size of “try this” keywords?February 1, 2016 at 3:48 pm #7518Ernest Marcinko
KeymasterYou can try a custom CSS code for that, something like:
[html]
p.asp-try a {
font-size: 18px !important;
}
[/html]That should do the trick.
February 1, 2016 at 4:12 pm #7519Alexander Vinnik
ParticipantThank you for fast reply!
February 2, 2016 at 6:15 am #7527Alexander Vinnik
ParticipantHi
I have a few issues:
1. The script you provided for mobile version:
[code]
<script>
var _scope = ASP.getScope();
_scope(function($) {
$("p.asp-try a").click(function(){
setTimeout(function(){
$("div.promagnifier").click();
}, 400);
});
});
</script>
[/code]does not work properly, when I save my footer.php file and load my webpage it works only for several searches after that it does not work as it should – it does not redirects to search results but make an ajax search instead;
2. Also I need this search results to open in a new page;
February 2, 2016 at 6:32 am #7528Alexander Vinnik
ParticipantBTW actually this one:
“2. Also I need this search results to open in a new page;”is not needed for now, just need to resolve the 1st issue
February 2, 2016 at 11:24 am #7538Ernest Marcinko
KeymasterHi,
It’s already a customization workaround, unfortunately I cannot guarantee it’s going to work.
You can try one more thing, maybe lowering the timeout value down to 50, and combining with the previous solution.
First possibility:
[html]<script>
var _scope = ASP.getScope();
_scope(function($) {
$("p.asp-try a").click(function(){
setTimeout(function(){
$("div.promagnifier").click();
var e = $.Event( "keyup", { which: 13 } );
$("input.orig").trigger(e);
}, 50);
});
});
</script>[/html]Second possibility:
[html]<script>
var _scope = ASP.getScope();
_scope(function($) {
$("p.asp-try a").click(function(){
setTimeout(function(){
$("div.promagnifier").click();
}, 50);
});
});
</script>[/html]One of them might work correctly, I’m betting on the first one.
February 2, 2016 at 4:20 pm #7544Alexander Vinnik
ParticipantUnfortunately it does not help:(
February 2, 2016 at 4:26 pm #7545Alexander Vinnik
Participantif there is no other solutions maybe as an alternate to make this:
only for mobile version (if possible?): when you click on try this keyword it just fills the search input with this keyword and then I can click on search button and it opens a search results
-
This reply was modified 10 years, 4 months ago by
Alexander Vinnik.
-
This reply was modified 10 years, 4 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.