var str = 'Текст, текст, текст, текст, текст, текст';
var p = document.querySelector('p');
var str_arr = str.split(',');
var i = 0;
var colors = ['red', 'green', 'black', 'yellow', 'green', 'orange', 'gray']; //массив цветов
p.innerHTML = str_arr[0];
setInterval(function(){
p.style.color = colors[i];
i = (i+1)%colors.length;
}, 1000);
<?PHP
$tmp = array_chunk($service_list,3);
foreach($tmp as $k => $v){
echo '<ul class="service_list">';
foreach($v as $row => $list_items)
echo "<li>$list_items[item] </li>";
echo '</ul>';
}
?>
$(document).ready(function () {
$(".btn").on("click", function () {
$(this).find(".img-animation").css({
"width": "100%",
"height": "100%",
});
var _this = this;
$(this).find(".text-description").fadeIn("slow",function(){
$(_this).find(".img-description").fadeOut("slow");
});
});
});
function iRead(item, options) {
....
this._events_read = [];
this._events_unread = [];
this.on = function(evt,func){
switch(evt){
case "newsRead":
this._events_read.push(func);
break;
case "newsUnread":
this._events_unread.push(func);
break;
}
}
}
iRead.prototype.read = function() {
this.item.addClass('read');
this._events_read.map(function(e){e();});
};
iRead.prototype.unread = function() {
this.item.removeClass('read');
this._events_unread.map(function(e){e();});
};
var s = new iRead();
s.on("newsRead",function(){alert("readed!")});
s.on("newsUnread",function(){alert("unreaded!")});
s.read();//readed
s.unread();//unreaded