// Copied from https://aspnet.codeplex.com/workitem/9879
// Vote number : 2
Hi,
it seems that the AjaxOptions.LoadingElementDuration attribute is not working as expected. Even if I change its value, the animation is always performed at the same speed.
It seems that jQuery needs an integer in order to set the correct duration value, but the unobtrusive AJAX library is rendering the value as a string.
Looking at the JavaScript code of "jquery.unobtrusive-ajax.js" I have seen this piece of code:
duration = element.getAttribute("data-ajax-loading-duration") || 0;
If I change it to:
duration = parseInt(element.getAttribute("data-ajax-loading-duration")) || 0;
The animation plays correctly. When it's a number, the duration argument in the jQuery show function is supposed to be an integer, not a string.
Please see this question on StackOverflow in order to get more details:
http://stackoverflow.com/questions/8928671/asp-net-mvc-3-loadingelementduration-not-working
Thanks.
Luca
Comments: Verified with 0103
// Vote number : 2
Hi,
it seems that the AjaxOptions.LoadingElementDuration attribute is not working as expected. Even if I change its value, the animation is always performed at the same speed.
It seems that jQuery needs an integer in order to set the correct duration value, but the unobtrusive AJAX library is rendering the value as a string.
Looking at the JavaScript code of "jquery.unobtrusive-ajax.js" I have seen this piece of code:
duration = element.getAttribute("data-ajax-loading-duration") || 0;
If I change it to:
duration = parseInt(element.getAttribute("data-ajax-loading-duration")) || 0;
The animation plays correctly. When it's a number, the duration argument in the jQuery show function is supposed to be an integer, not a string.
Please see this question on StackOverflow in order to get more details:
http://stackoverflow.com/questions/8928671/asp-net-mvc-3-loadingelementduration-not-working
Thanks.
Luca
Comments: Verified with 0103