Hello,
I have problem with all element with collapsed-out after ajax-call-load in
setInterval executed immediately all collapsed-out became collapsed-in
automatically.
It should be kept collapsed-out if not command to collapse-in
Any idea ?
Note: I've been test by disabling ajax-call-load in setInterval and all
collapsed-out not become collapsed-in. Bootstrap 2.3.2
Example:
<div id="totalmessage"></div>
<div id="totalmessage1"></div>
<div data-toggle="collapse" data-target="#collout" class="btn
btn-small">expand</div>
<div id="postdata">Click to Post</div>
<div class="collapse out" id="collout">
My collapsed out data and refreshed after postdata clicked
</div>
<script type="text/javascript">
$('#postdata').click(function(e){
e.preventDefault();
$.ajax({
type : "POST",
url : "/comments.php?jfocode=add&ajax=true",
data : { content : 1234 },
success : function(data) {
//reload data seamesly
$('#collout').html(data);
}
});
return false;
});
setInterval(function(){
$.ajax({
type : "GET",
dataType: "json",
url : '/message.php',
data : 'jfocode=getmsgcount&location=INBOX&status=NEW&ajax=true',
success : function(data) {
$('#totalmessage').ajaxComplete(function(event, request,
settings){
if (data.totalmessage)
{
$('#totalmessage').html(data);
$('#totalmessage1').html(data);
if (data.totalmessage > 0)
{
$('#totalmessage').show();
$('#totalmessage1').show();
}
else
{
$('#totalmessage').hide();
$('#totalmessage1').hide();
}
}
});
}
});
return false;
}, 10000);
</script>
--
You received this message because you are subscribed to the Google Groups
"twitter-bootstrap" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.