Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › CSS Issue
- This topic has 11 replies, 2 voices, and was last updated 9 years, 1 month ago by
Jan Trier.
-
AuthorPosts
-
April 28, 2017 at 4:58 pm #12905
Jan Trier
ParticipantHey,
I want to set the size of the front from my Ajax search to 16px at all mobil devices where the width is smaller then 500px…
How can I do that?
Greetings and Thank You!
May 1, 2017 at 8:39 am #12923Ernest Marcinko
KeymasterHi!
The best possible way in my opinion is to use a custom CSS with a media query, something like this:
[html]@media only screen and (max-width: 500px) {
input.orig,
input.autocomplete {
font-size: 16px !important;
}
input.orig::-webkit-input-placeholder {
font-size: 16px !important;
}
input.orig::-moz-placeholder {
font-size: 16px !important;
}
input.orig:-ms-input-placeholder {
font-size: 16px !important;
}
input.orig:-moz-placeholder {
font-size: 16px !important;
}
}[/html]May 1, 2017 at 11:32 am #12938Jan Trier
ParticipantHey,
Thank You!
And is it possible to call a class by the first char a user has typed?
I want to call: class=”spu-open-58189″Greetings
May 1, 2017 at 11:34 am #12939Jan Trier
ParticipantAnd your CSS Code isn’t working… :/
May 1, 2017 at 12:08 pm #12940Ernest Marcinko
KeymasterHi,
The CSS code is working, I just checked your site, it is active: http://i.imgur.com/wexJezy.png
Make sure to clear all layers of cache, including browser, site, server, CDN etc..And is it possible to call a class by the first char a user has typed?
Can you please be more specific about this? Where do you want to add this class, which element? Do you want to add it to an element whenever at least 1 character was entered?
It is possible I guess, but only with a custom script. But I need to know which element is affected.May 2, 2017 at 2:04 pm #12944Jan Trier
ParticipantI have a plugin which can show/trigger popups. The trigger to show that popup is: class=”spu-open-58189″
For example: <button class=”spu-open-58189″>Submit</button> Would trigger and show the popup.You can just check out my sidebar at the right hand side of a product page and click on a button like this. Then a popup opens.
Now I want to trigger another popup which comes every time a user enters the first char.The cookie should handle that the popup doesn’t get triggered the next time if a user searches the next time. (If not, is it possible to create that by the Ajax search with the cookie and next time don’t popup?)
That is what I want to do! 😀
May 5, 2017 at 2:58 pm #12983Ernest Marcinko
KeymasterHi!
I understand, and I believe it is possible. There is a javascript API available with the plugin, which allows executing functions on certain events, you can read more about it here: Ajax Search PRO javascript API
The simplest solution in my opinion is this, place it into the functions.php file in your active theme directory (copy from line 3):
Please note that this is out of the scope of support, so I can’t promise this code will work in every situation out there.
Before making any changes, make sure to have a back-up copy of your site, in case anything goes wrong.May 5, 2017 at 3:21 pm #12984Jan Trier
ParticipantHey Ernest,
Thank you for you greate support! – I understood your code. And it is working! – Thank You!
But there is one little issue. The plugin “Popups” set a cookie so it knows the next time the user comes to the website, if the trigger should be triggered or not. Do you have an idea how I can add that to the if condition?I think the plugin works like this:
The plugin sets a cookie with a expire date. If the cookie is still alive, the popup doesn’t get triggered!
If not, the popup gets triggered.Independent of the user got subscribed or not, I think it is okay to check of there is a cookie with the name spu_open_58189 or not. The value is not necessary – Because I want to show the popup again if the user hasn’t subscribed. That is the reason, why the popup will be shown again after 10 days.
In the attachment you will find two pictures. One of the cookie where the user got subscribed and one where the user doesn’t got subscribed!
Thank You!
May 5, 2017 at 4:46 pm #12987Ernest Marcinko
KeymasterI see, it sets a cookie, so it’s not displayed multiple times over the 10 day period.
In that case, this should be the final solution:
May 5, 2017 at 4:57 pm #12988Jan Trier
ParticipantThank You a lot Ernest! – This solved my problem! 😀
Could you maybe also respond to this ticket? – I still didn’t recived any answers… :/
And I think, your are one of the best supporters. Thats the reason, why I ask you 🙂https://wp-dreams.com/forums/topic/improve-search-bar-results/
May 5, 2017 at 5:01 pm #12989Ernest Marcinko
KeymasterI will of course, as soon as I can today 🙂 And thank you for your kind words!
There are lots of tickets open (this, and on another system + mails as well), and I want to answer everything thoroughly, it takes some time 🙂 Sorry for the delays.
May 5, 2017 at 5:01 pm #12990Jan Trier
ParticipantNo problem, you’re welcome!
See u -
AuthorPosts
- You must be logged in to reply to this topic.