I'd like to append some data to the HTML element, so I've used the following code:
$("#bookListDiv").append(data.HTMLString);
and everything has working, but then I'd like to add a fadein animation while displaying this element, so I've modified it to:
$(data.HTMLString).hide().appendTo("#bookListDiv").fadeIn(1000);
Animation is working on Chrome but on Firefox I see the following error in console: TypeError: Argument 1 of Window.getComputedStyle does not implement interface Element. I'm using jquery 1.8.2.
Could you advise me what can be wrong? I supposed something with data, but in the first approach everything is working correctly.
I've found the solution by adding the delay before fadeIn function. Code after changes:
$(data.HTMLString).hide().appendTo("#bookListDiv").delay(100).fadeIn(1000);
As I've noticed the number in delay is should be adjusted to the size of data, in my case for 7KB json data it is working, but I've started from 1000.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments