load data only when slide down with jquery
- by hd
I have a link that when user clicks on it some data loaded into a div. I want to display waiting message to user until the data fetch completely from server and then show it to user.
I also want to call the data url happen only when the result box is going down(slide down) not in both of slide down and slide up events to reduce load on server.
my code is here but i don't know how implement second part into it:
$(document).ready(function() {
$("#prereq").hide();
$("#prereqlink").click(function() {
$("#prereq").html("please wait ...");
$("#prereq").slideToggle("slow");
$.ajax({ url:"referee.php",
success:function(data) {
$("#prereq").html(data);
}
});
});
});
would you help me??