#1BadWolfMar Dec 29, 2015 6:15 pm
BadWolf
Fondator
Creati un JavaScriptp
Nume: Reputatie IPB
Amplasare: In Topicuri
Cod:
- Cod:
$(document).ready(function() {
$(".pun .post .user").each(function(){
$(this).html($(this).html().replace(/<span class="label/g,'<dd><div class="post_field"><span class="label'));
});
$('.user-info .post_field:contains("Reputatie")').each(function() {
var rep = $(this).text().match(/\d+/g);
$(this).addClass('reputation');
$(this).append('<span class="title" style="font-weight:normal"></span>');
if(rep == 0) {
$(this).find('.title').text('Neutro');
$(this).addClass('zero');
}
else if(rep >= 1 && rep < 5) {
$(this).find('.title').text('Iniciante');
}
else if(rep >= 5 && rep < 10) {
$(this).find('.title').text('Membro ativo');
}
else if(rep >= 10) {
$(this).find('.title').text('Excelente');
}
});
});
IN CSS
- Cod:
.reputation {
background-color: rgb(141, 177, 62)!important;
background-image: url(http://i38.servimg.com/u/f38/17/31/71/58/highli10.png);
border-radius: 3px;
color: rgb(255, 255, 255);
font-weight: bold;
display: block;
margin: 0 auto;
margin-bottom: 3px;
padding: 3px 7px;
max-width: 125px;
text-align: center;
text-shadow: rgba(0, 0, 0, 0.298039) 0px -1px 0px;
background-position: 0px 1px;
background-repeat: repeat no-repeat;
}
.reputation.zero {
background-color: rgb(16, 16, 16)!important;
color: rgb(255, 255, 255);
}