0
The system I am working generates a li with a contact list, every minute Jquery makes a query to check if it has message to any user from the list. Currently if you have a message, the system inserts a class in i inside href and flashes to indicate a new message.
I want to reposition a li that you have a new message in the first position of the list, when you have a new message.
For example, when you have a message for so-and-so 4, I want to pose the above (Closest) in the first position of the list.
<li>
<a href="#" data-process-id=1 id="chatByContact" class="chatByContact">Fulano 1<i class="fa fa-comments"></i></a>
</li>
<li>
<a href="#" data-process-id=2 id="chatByContact" class="chatByContact">Fulano 2<i class="fa fa-comments"></i></a>
</li>
<li>
<a href="#" data-process-id=3 id="chatByContact" class="chatByContact">Fulano 3<i class="fa fa-comments"></i></a>
</li>
<li>
<a href="#" data-process-id=4 id="chatByContact" class="chatByContact">Fulano 4<i class="fa fa-comments"></i></a>
</li>
The goal is to sort the li’s according to the
data-process-id
?– Isac
No, the order of the read doesn’t matter. Every time a new message arrives the fa-comments starts to blink, what I want is that I read above the fa-comments be transferred to the first read from the list. I’m thinking of a big list, if the message read has there at the end of the list, the user will not see the blinking item.
– RRV