by Ange Tuteur January 27th 2018, 4:52 pm
Thanks.
After looking over it, it seems I forgot to include some CSS for the table itself. If added the necessary code to your stylesheet and updated
my prior post with it. You can find the same CSS at the bottom of your stylesheet and an example of the scroller working
here.
As for tooltips, you can insert them into the [td] tags via the
title attribute. See the example below.
- Code:
[td class="a_member" title="AWARD TITLE"][/td]
Of course the problem with this method is that we're limited to 65,535 characters in the text field, so adding titles directly will end up making you reach the limit faster. Not to mention if you make a typo or want to change the title you have to edit everyone's profile who has it. The method I used on my forum used javascript to insert the titles ; it's more convenient since you only have to edit a single file to update the titles.
Admin Panel > JavaScript > New
Placement : All pages
- Code:
$(function() {
var titles = {
a_member : 'Registered'
},
a = document.getElementsByTagName('TD'),
i = 0,
j = a.length,
c;
// apply the titles based on the award class name
for (; i < j; i++) {
c = a[i].className;
if (c && /^a_.*?$/.test(c)) {
a[i].title = titles[c] || c.slice(2);
}
}
});
Simply edit the
titles object to add more titles to the script.
- Code:
var titles = {
a_member : 'Registered'
},
It uses
CLASS:TITLE pairs, so all [td] tags with the class
a_member will show the texts
registered when hovered. You don't have to prefix your classes with
a_, you can use something else such as
award_ if you want, but I recommend keeping it short to save space in the profile field.
Here's an example of a bunch of awards with different titles, so you can get an idea of how it's formatted.
- Code:
var titles = {
a_awardmaker : 'Award Maker',
a_membotm : 'Member of the Month',
a_member : 'Registered',
a_helloworld : 'Hello world!',
a_avatar : 'Picture Perfect',
a_signature : 'John Hancock this please',
a_website : 'Site sweet site...',
a_hobbyist : 'Hobbyist',
a_ptitle : 'They call me...',
a_affiliate : 'Affiliate',
a_beta : 'Beta Tester',
a_promoter : 'Self promotion rules!',
a_bugbuster : 'Bug Buster',
a_suggestion : 'The Power of Suggestion',
a_banhammer : 'The Almighty Ban Hammer',
a_thinker : 'Thinking out loud',
a_fmdbday : 'Happy Birthday',
a_collector1 : 'Award Collector',
a_collector2 : 'Award Hunter',
a_collector3 : 'Award Freak',
a_collector4 : 'God of Awards',
a_likeable : 'Likeable',
a_loveable : 'Loveable',
a_idol : 'Idol',
a_contributor : 'Contributor',
a_writer : 'Born Writer',
a_keywarrior : 'Keyboard Warrior',
a_pressstart : 'Press Start',
a_highscore : 'High Score!',
a_number1 : 'Number 1',
a_year1 : '1st Year',
a_year2 : '2nd Year',
a_year3 : '3rd Year',
a_group1 : 'Welcome to the Club',
a_group2 : 'The Inner Circle',
a_group3 : 'Club Juggler',
a_friend : 'Friendly',
a_friend2 : 'Friend Lord',
a_friend3 : 'Friendzone Master',
a_pm : 'Between you and me...',
a_pm2 : 'Privacy is Precious',
a_pm3 : 'Keeper of Secrets',
a_liker : 'I like you',
a_liker2 : 'I love you',
a_liker3 : 'I idolize you',
a_topic : 'My First Topic',
a_topic2 : 'Stay on Topic',
a_topic3 : 'Topic Starter',
a_tester : 'Test Dummy',
a_tester2 : 'QA Team Leader',
a_tester3 : 'Mad Scientist',
a_artist : 'My First Piece',
a_artist2 : 'Aspiring Artist',
a_artist3 : 'Art is Love',
a_teacher : 'I\'m your new Teacher',
a_teacher2 : 'Today\'s lesson is...',
a_teacher3 : 'Best Teacher Ever',
a_month1 : 'Postman',
a_month2 : 'Carrier Pigeon',
a_month3 : 'Spam Bot'
},
If any questions let me know.
Have a good weekend.