Expand my Community achievements bar.

SOLVED

Dose AEM support JQuery animate function?

Avatar

Former Community Member

Hi there,

Please see the snippet code below:

function runProgress(id, percentage, speed, isSwitched) { $("#uploadedFileNo").show(); var wii = parseInt(percentage) / 100 * progressBarWidth; if(speed == "normal") { $("#ProgressBar" + id).animate({width : wii}, "normal", function() { var displayData = percentage + "%"; alert("displayData: " + displayData);/////// $("#bp"+ id).find(".icons").text(displayData); if (percentage == 100 && isSwitched) { queryFileProfile(id); uploadedFileNo++; $("#uploadedFileNo").html("- Uploaded: " + uploadedFileNo); } }); } else { $("#ProgressBar" + id).animate({width : wii}, 10, function() { var displayData = percentage + "%"; $("#bp"+ id).find(".icons").text(displayData); if (percentage == 100) { queryFileProfile(id); uploadedFileNo++; $("#uploadedFileNo").html("- Uploaded: " + uploadedFileNo); } }); } }

As a result i notice that animate not work at all. I suspect CQ5 if support that?

Anyone could comment on it? Thanks a lot in advance.

 

Best regards,

Brian

1 Accepted Solution

Avatar

Correct answer by
Level 9

Yes, jquery works with CQ5. It is a javascript framework, fully supported by CQ5. You have have to include clientlibs (javascript ) files in your component.

OOTB has jquery files, you need to add dependencies in order for it to work.

Here is an article on how you can integrate jquery with your application

http://helpx.adobe.com/experience-manager/using/integrating-jquery-framework-cq.html

Please check whether you are following all the instructions defined in this article.

View solution in original post

3 Replies

Avatar

Correct answer by
Level 9

Yes, jquery works with CQ5. It is a javascript framework, fully supported by CQ5. You have have to include clientlibs (javascript ) files in your component.

OOTB has jquery files, you need to add dependencies in order for it to work.

Here is an article on how you can integrate jquery with your application

http://helpx.adobe.com/experience-manager/using/integrating-jquery-framework-cq.html

Please check whether you are following all the instructions defined in this article.

Avatar

Former Community Member

Hi Mshajiahmed,

Thanks for your reply. I check and see that article you comment. Certainly, i made sure the necessary JQuery lib was added into clientlibs before i post this question. But, just only that function

animate() always not work rather than jquery, i think it is a little weird.

Avatar

Level 9

I think it could be some of jquery properties for animate is not set properly.

Try to debug before after and calling this function in firebug or Google dev tools.

Please check this on stack overflow as well

http://stackoverflow.com/questions/22576699/jquery-animate-not-working