Issue with prependTo() and hide()
I have a JS script that will execute an ajax check every X seconds for new content and if any is found, it will prepend it to the top of a timeline. I wanted to get an effect of it sliding down the other content of the timeline, Heres the script thus far:
-
$.get( '/some/url', function ( items ) {
// Error: Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
$( items ).hide().prependTo( ".timeline" ).slideDown();
// This works fine, just doesn't slide
//$( items ).prependTo( ".timeline" );
} );
So the error is the line with the prependTo, it throws the error:
Error: Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
The weird part is it worked fine a while ago, I just made so many changes/commits,
that I'm not at all sure what caused it to stop working
Any help would be great! Thanks.