Community Central

Admin Forum:CSS/JS span tag

18,814pages on
this wiki
Add New Page
Add New Page Talk0

This Forum has been archived

Forums: Admin Central Index Technical Help CSS/JS span tag
Central's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.
Note: This topic has been unedited for 1312 days. It is considered archived - the discussion is over. Do not add to unless it really needs a response.

Hi everyone! I'm here to ask if one can make <span></span> (or similar) tags in CSS/JS? I want to add a highlight system to Locomotive Wiki I'm an admin on, and I'm fine with the syntax for setting up the highlight, but I'm interested to know if there is a way I can get a mouse-over the userpage links to say "This user is the Founder" or "This user is an Administrator" etc. Is there a way to get the a:hover (CSS) or onmouseover (JavaScript) to display such a title? :)

PS I don't know anything about JS yet, but I'm begining to pick up CSS! so hopefully you don't have to explain the the latter quite as much (if it turns out to be CSS).

Starfleet Academy "Live long and prosper." 06:45, February 8, 2012 (UTC)

$('[href="/wiki/User:Admin1"], [href="/wiki/User:Admin2"], ...').attr('title', 'This user is an admin');

 TK999 17:49, February 9, 2012 (UTC)

I should point out that TK's code is JS, and should be added to your wiki's Common.js page.    ǝsʞpɐןǝ  (message wall)  18:10, 9/02/2012
Cool guys! Thanks for the code TK-999, really appreciate it. Oh and thanks Eladkse, I did get that, but I probably would have added it to Wikia.js. Don't stress if you happen to see me putting it in my personal wikia.js. I've got to get this set-up before I present it to the Founder of LW. See you 'round :)
Starfleet AcademyHail my ship23:50, 9 Feb, 2012 UTC

(Indent reset) Hi, back again. The code didn't work, I don't know why. If it's going to be a pain don't bother trying to get it to work. :)

Starfleet AcademyHail my ship01:31, 10 Feb, 2012 UTC

It will need to be inside a .ready() like so...

$(function () {
  $('[href="/wiki/User:Admin1"]').attr('title', 'This user is an admin');
Rappy 02:09, February 10, 2012 (UTC)
Hi Rappy, I've got it to work :) Thanks Rappy, I knew I must have been doing something wrong! It seems to be working nicely now: (see here)
Now I'm off to add the color part of the highlight (which as been kicking around in my personal css for awhile now.).
Starfleet AcademyHail my ship03:31, 10 Feb, 2012 UTC

Also on Fandom

Random Wiki