Update row with a pulse effect
We increase vote by time intervals
var rowData = [
{
"figure": "5693b26b0ae6a.jpeg",
"name": "Onirim",
"vote": 42,
"by": "Immersive Garden",
"from": "France",
"date": "January 22, 2016"
}, {
"figure": "5692e0a36d132.jpeg",
"name": "Jumeirah Inside",
"vote": 47,
"by": "MediaMonks",
"from": "Netherlands",
"date": "January 21, 2016"
}, {
"figure": "568eae5d0eced.jpeg",
"name": "Atieva",
"vote": 67,
"by": "Atieva",
"from": "U.S.A.",
"date": "January 20, 2016"
}, {
"figure": "568c839702fb6.jpeg",
"name": "Highline: America's Most Admired Lawbreaker",
"vote": 51,
"by": "Gladeye",
"from": "New Zealand",
"date": "January 19, 2016"
}
];
var options = {
rowUpdateEffect: "pulse",
cellWidth:[300, 300, 100],
styles: "burlywood",
rowTemplates: [
"<img style='width: 280px;height: 200px' src='sub/img/{{figure}}'> ",
"<div><p style='font-size: 28px;color: #1e6bb8;'>{{name}}</p>" +
"<p>By: {{by}} From: {{from}}</p>" +
"<p>Date: {{date}}</p>" +
"</div>",
"<div style='text-align: center'>Votes: <p style='font-size: 30px; color: brown;'>{{vote}}</p></div>"
]
};
var ultraTable = $("#mytable").animatedTable(options);
ultraTable.data(rowData);
window.setInterval(function() {
var r = Math.floor(Math.random()*4);
rowData[r].vote += Math.floor(Math.random()*5);
ultraTable.updateRow(rowData[r], r);
}, 2000);