Fabled.day

contents

A (Subtle) Scrolling <title> Tag

I’m positive you’ve seen it browsing neocities. I know I did. Those sites with animated <title> tags. You visit them, and the title scrolls through the tab on your browser. Very neat, and often quite beautiful when some special characters are included.

I avoided including this feature in my site for quite some time. Many people told me never to include it, especially on Reddit. I was told it was annoying and distracting, especially when your visitors are in another tab. I thought about this a bit, and found a workaround - namely, a marquee that only moves when the visitor is actively focused on your website’s tab, and which defaults back to a static title when the visitor click’s away.

I shuffled through Reddit and other sites. In some marquee <title> versions, it also apparently includes a method of determining if the user prefers no motion according to their accessibility settings in the browser, but I’m not sure how that works yet. Initially, I found a script that did the exact opposite of this. Because people wanted to be “eye-catching” and draw people back to their sites from other tabs, I guess.

I doubt that works, and I still think this method is more gentle and inviting to the visitor. Some folks did, as I said, tell me to never animate the <title> tag because they found it irritating. I, however, see this as having some functionality now. A lot of my page titles are rather long, and may not fit within a browser tab legibly. If they slowly, slowly scroll (and speed is controllable), then the visitor can see the entire page title while browsing.

Anyways, I would love to provide a link to Code Pen demonstrating this as I’ve done with other trinkets, but since Code Pen itself only executes material between the <body> tags, and won’t let you use Javascript to fiddle with <title>, I can’t. Instead, I’m sharing the Javascript below, and you can easily see how the script functions on this very site - just look at the title…

Please note that this may cause issues with how the site’s title is displayed other places, ie, when it appears as a link on social media. I saw this happen once, and only once. It is a mystery to me, as the dabblesome beginner that I am.

Trinket Itself