HOT next to topic
2 posters
Page 1 of 1
HOT next to topic
@JScript would you know why this code is not working?
New JavaScript
Placement Subforums
CSS
Forum Link: TPSN
forum type: punBB
Thank you for the help in advance!
New JavaScript
Placement Subforums
- Code:
$(document).ready(function(){
$('thead:contains("Replies")').each(function() {
$(this).parents('.main-content').find('td.tc2').each(function() {
var number = $(this).text();
var hot = '<span class="hot_topic">HOT</span>';
if(number >= 5) {
$(this).append(hot);
}
});
});
});
CSS
- Code:
.hot_topic {
background: #ED7710;
display: block;
height: 16px;
margin: 0 auto;
max-width: 45px;
line-height: 16px;
padding: 1px 5px;
font-size: 9px;
font-weight: bold;
text-transform: uppercase;
color: #fff;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
vertical-align: middle;
}
Forum Link: TPSN
forum type: punBB
Thank you for the help in advance!
Re: HOT next to topic
try this
- Code:
$(document).ready(function(){
$('.tc3').each(function() {
$(this).each(function() {
var numb = $(this).text().replace(/(Replies\d+ Views)/,'')
var hot = '<span class="hot_topic">HOT</span>';
if(numb >= 5) {
$(this).parent().find(">:first-child").append(hot);
}
});
});
});
Re: HOT next to topic
my fault i missed a ;
- Code:
$(document).ready(function(){
$('.tc3').each(function() {
$(this).each(function() {
var numb = $(this).text().replace(/(Replies\d+ Views)/,'');
var hot = '<span class="hot_topic">HOT</span>';
if(numb >= 5) {
$(this).parent().find(">:first-child").append(hot);
}
});
});
});
Re: HOT next to topic
@_Twisted_Mods_ Thank you sir that worked great just needs abit of styling now *)
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum