Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
62
rated 0 times [  63] [ 1]  / answers: 1 / hits: 15565  / 10 Years ago, thu, april 3, 2014, 12:00:00

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.


More From » jquery

 Answers
6

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.


[#71629] Wednesday, April 2, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
xavier

Total Points: 711
Total Questions: 91
Total Answers: 121

Location: Gabon
Member since Sat, Jul 25, 2020
4 Years ago
;