Does anyone know how I can make this bit of code have a .fadein property? Preferably .fadein medium speed would be the best. Thanks!
<script>
function LinkOnClick4(box) {
$('#friendresults').load('conversation.php?id=' + box);
}
</script>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
First hide the element, load it’s contents, and then use the callback function of the
loadfunction to fade it back in:If you want the element to keep its space in the page (not totally disappear) then you can just set it’s opacity rather than using the
.hide()and.fadeIn()functions:The difference between the two code-blocks is that the first one will allow elements relatively positioned around the
#friendresultselement to shift when it’s hidden, and the second code-block keeps the page from shifting around when the#friendresultselement is hidden/shown.Some docs if you need more help:
.hide(): http://api.jquery.com/hide.fadeIn(): http://api.jquery.com/fadein.fadTo(): http://api.jquery.com/fadeto.css(): http://api.jquery.com/css