• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1682
  • Last Modified:

Jquery ui autocomplete and keyup animation

Hi Experts,

I have this code which works great...
source: function(request, response) {
                url: "/wp-content/themes/default/php/json.all.php",
                dataType: "json",
                data: {
                    term: request.term,
                success: function(data) {
                    response(data.slice(0, 5));
 minLength: 2,
 select: function( event, ui ) {
            window.location = ui.item.url;

Open in new window

I now want to add an animation class (.loader) to #s parent div whilst someone is typing... which removes after the autocomplete has loaded or until focus out.

Could someone please assist.

Many thanks in advance
1 Solution
Roopesh ReddyIT AnalystCommented:

I assume, your HTML is like this -

        <input type="text" id="s" />

Open in new window

If yes, then you can add the following script -
        $('#s').on("focus", function () {
        $('#s').on("blur", function () {


Open in new window

Hope it helps u...
maccaj51Author Commented:
Many Thanks
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now