wildgoosespeeder
Code Helper
Tiers are for strangers!
Posts: 530
wildgoosespeeder said 161 great things
|
Post by wildgoosespeeder on Oct 4, 2010 15:47:17 GMT -8
Browser Tested: Internet Explorer 7/8, Firefox, Chrome, Opera, and Safari When hovering over the board icon with your mouse, it displays "[/li][li]" for new posts and "[ ]" for no new posts. This simple code aims to fix that. Also works for sub-boards. Text is customizable in red. PreviewGlobal Footer (Preferably below all other codes and HTML in the Global Footer) <script language="javascript"> /*Board Icon Alt/Title Fix by wildgoosespeeder*/ //Customization var newPosts = "New Posts"; var noNewPosts = "No New Posts";
//Don't edit below var td = document.body.getElementsByTagName("td"); for(t = 0; t < td.length; t++) { if(td[t].width == "8%" && td[t+1].width == "66%" && td[t+1].getElementsByTagName("a")[0].href.match(/board=/i)) { if(td[t].getElementsByTagName("img")[0].alt == " [/li][li]" || td[t].getElementsByTagName("img")[0].title == "[/li][li]") { td[t].getElementsByTagName("img")[0].alt = newPosts; td[t].getElementsByTagName("img")[0].title = newPosts; } if(td[t].getElementsByTagName("img")[0].alt == "[ ]" || td[t].getElementsByTagName("img")[0].title == "[ ]") { td[t].getElementsByTagName("img")[0].alt = noNewPosts; td[t].getElementsByTagName("img")[0].title = noNewPosts; } } } </script>[/tt][/pre] *Also using it on main page of this site.
|
|
|
Post by Wormopolis on Oct 4, 2010 17:57:18 GMT -8
simple yet very useful! Im surprised I havent seen this before!
|
|
wildgoosespeeder
Code Helper
Tiers are for strangers!
Posts: 530
wildgoosespeeder said 161 great things
|
Post by wildgoosespeeder on Oct 4, 2010 18:48:08 GMT -8
Thank you. You can find this code on ProBoards Support as well.
|
|
wildgoosespeeder
Code Helper
Tiers are for strangers!
Posts: 530
wildgoosespeeder said 161 great things
|
Post by wildgoosespeeder on Oct 28, 2010 15:43:18 GMT -8
You may want to update the codes because I noticed a potential flaw with the code. Unlikely the case, the old code would apply it to any image with alt/title being "[/li][li]" or "[ ]" and you want it to only apply to board icons. Now it only applies to board icons. Also copy the codes by modifying my post because the strange thing with [pre][/pre] is it makes the entire script one line when copied and viewing the post.
|
|
|
Post by Wormopolis on Oct 28, 2010 22:49:32 GMT -8
which would lead to the question of why anyone would title/alt their pictures with that...
|
|
wildgoosespeeder
Code Helper
Tiers are for strangers!
Posts: 530
wildgoosespeeder said 161 great things
|
Post by wildgoosespeeder on Oct 29, 2010 0:10:05 GMT -8
I know it sounds weird but hey, a fix is a fix.
|
|
|
Post by Wormopolis on Oct 29, 2010 0:19:32 GMT -8
Also copy the codes by modifying my post because the strange thing with [pre][/pre] is it makes the entire script one line when copied and viewing the post. why not just use the code tag?
|
|
wildgoosespeeder
Code Helper
Tiers are for strangers!
Posts: 530
wildgoosespeeder said 161 great things
|
Post by wildgoosespeeder on Oct 29, 2010 17:43:07 GMT -8
why not just use the code tag? I copied these codes from ProBoards Support and their code tag formatting I hate because I like my code indented appropriately. Plus my quick reply code (other thread, I know) would terminate early otherwise.
|
|