I created a (right)side bar for display all new post (like facebook). Now If user mouse over any post, It's fade in a new box to display full post (like facebook).
This side bar get all new posts by a ajax request after 5 second interval. And this below code I used for mouseover to display full post.
$(".upbox1").mouseover(function() {
var id = $(this).attr('id').replace('','');
$("#menu").fadeIn("slow");
$('.loader2').show();
$.get("uphover?id="+id, function(data) {
$('#menu').empty().html(data);
$('.loader2').hide();
});
});
After load the page 1st time the mouseover display well but just 5 second interval when side post reload again mouseover cannot display anything.
How to solved it please?
All script placed in same file: my side bar's update script:
var uid = '<? echo $session->id; ?>';
function addside(type, msg){
//Do something for display all new post in side bar.
}
function waitFormailno(){
$.ajax({
type: "GET",
url: "updateside.php",
cache: false,
async : false,
dataType : 'json',
data: "uid="+ uid,
timeout:15000,
success: function(data){
addside("MyDivId", data);
setTimeout(waitFormailno, 15000);
},
error: function(){
setTimeout(waitFormailno, 15000);
}
});
}
$(document).ready(function(){
waitFormailno();
});