tags:

views:

140

answers:

1

Hello,

I use an ajax call to retrieve a div that I want to prepend to my results DIV. I don't want to add the style display:none to the div before it is returned because I use the same code elsewhere and don't want that style attached.

That being said how do I prepend an element to a div already hidden so I could use the fadeIn or slideIn function.

Here is what I have so far:

$('#results').prepend(singleresult);

singleresult contains a div with the result.

How do I make singleresult hidden before I prepend it so I can use a fancy automation function to get it to show?

+2  A: 

add a class to this div and do this css .myPrependDiv {display:none;} or just use .ajaxDivHolder div{display:none} after that the jquery fadein or slidein function will overwrite it.

antpaw
ok so something like this:$('#results').prepend(ajaxDivHolder); // CSS has this hidden$(.ajaxDivHolder).html(singleresult).slideDown("slow");That sounds good, let me try that.
Randy Johnson