Codul folosit
insa nu inteleg ce are daca pun asa nu se comuteaza ma poate ajuta cineva ?
Am gresit eu undeva ? Sau exista alta solutie ?
Cod:
$('.forabg ul.topiclist.forums li.row').each(function(){
var NoRead = $(this).find('a.last-post-icon:has(".sprite-icon_topic_latest")').attr('href');
$(this).find('a.forumtitle').after('<a href="'+NoRead+'" class="read" style="background: none repeat scroll 0 0 #DADADA;color: rgb(80, 80, 80);font-weight: 800;padding: 1px 3px;display:inline;border-radius: 2px;border: 1px solid #CCC;">Read</a>');
});
$('.forabg ul.topiclist.forums li.row').each(function(){
var NoUnread = $(this).find('a.last-post-icon:has(".sprite-icon_topic_newest")').attr('href');
$(this).find('a.read').replaceWith('<a href="'+NoUnread+'" class="unread" style="background: none repeat scroll 0 0 #55A716;color: #ffffff;font-weight: 800;padding: 1px 3px;display:inline;border-radius: 2px;border: 1px solid #5CB31A;">Un Read</a>');
});
insa nu inteleg ce are daca pun asa nu se comuteaza ma poate ajuta cineva ?
if ($("li.row:has(".sprite-icon_topic_newest")").length > 0){
$('.unread').replaceWith($('.read'));
}
else if ($("li.row:has(".sprite-icon_topic_latest")").length > 0){
$('.read').replaceWith($('.unread'));
}
else {
return false;
}
Am gresit eu undeva ? Sau exista alta solutie ?