I have two recommendation for your code to solve your problem
One Way
Change your JavaScript function to something like this
var prevId;
function toggle_visibility(id, newsId) {
if (prevId) {
$("#"+prevId).slideToggle("slow");
}
$("#"+id).slideToggle("slow");
if (id=="news_det" && newsId!=undefined) {
var val=$("#det_"+newsId).val();
$('#news_detDiv').html(val);//Where you are putting text that div id
}
prevId = id;
return false;
}
Change your html snippet from $news
variable to this
$news.='<table width="800" border="0">
<tr>
<td style="width:150px;">' . $date . '</td>
<td style="width:600px; overflow:hidden;"><a href="#" onclick="toggle_visibility(\'news_det\', '.$id.');" style="color:#b19057;">' . $title . '</a></td>
<td style="width:50px"><a href="#" onclick="toggle_visibility(\'news_det\', '.$id.');" style="color:#000;">...more</a></td>
<input type="hidden" value="'.$text.'" id="det_'.$id.'">
</tr>
</table>';
In this way you will save your server call, since you will be storing all your text in your page only and you will always see relevant post data on click of title & more. Moreover your effect will also work.
Second Way
You should use JQuery AJAX call on click of title & more to get data from server instead of going with refreshing page.
Happy Coding!!!