JQuery empty () / remove () makes a page transition

I have a monitoring site that shows "who is logging in" and their "status" (online / away / etc.).

They basically wrap at the bottom of my page:

<table cellpadding="0" cellspacing="0" id="telecaster_agentenstatus" class="telecaster">
            <tr>
                <td id="free_agents">
                </td>
                <td id="acw_agents">
                </td>
                <td id="pause_agents">
                </td>
            </tr>
            <tr id="telecaster_agentenstatus_start">
                <td id="agentenstatuus" colspan="3">
                    <div class="agent_telecaster_container"></div>
                </td>
            </tr>
        </table>

So, all the "agents" fall into the div with the class "agent_telecaster_container". I add as many divs as I need:

for (nameAgent in supervisionagents.group[0].agent) {
            //$("#agentenstatuus").append('<div class="agent_telecaster">'+nameAgent+'</div>'); 
            counter++;

            if (supervisionagents.group[0].agent[nameAgent].stateCurrent.description == "idle") 
            {
                $(".agent_telecaster_container").append('<div id="agent'+counter+'" class="agent_telecaster"><img src="images/icons/box_green_12x12.png">&nbsp;' + nameAgent + '</div>');
            }

which is called again and again.

I need to “clear” its contents, because it may be that every second user goes offline or via the Internet.

Until now, this has been possible with a simple:

$('.agent_telecaster_container').empty() / .remove();

, /, , ( ) . , - /, , .

- , ?:/

+3
3

, ? ..hide() (); fadeOut(), remove() :

.fadeOut('fast',function( $('.agent_telecaster_container').remove(); ));
0

, , wertical scrollbar. .

0

: -)

$('#agentenstatuus').css('height',$('.agent_telecaster_container').height());

:-) div, !

- CSS .css .

0

All Articles