inherit
67871
0
Oct 30, 2012 15:45:09 GMT -8
Code Dragon
Chillin'
468
December 2005
chaobreederxl
|
Post by Code Dragon on Sept 18, 2006 18:07:50 GMT -8
This code allows you to highlight any text with any color of your choosing. Just use [ highlight= COLOR] TEXT[/highlight] and change COLOR to the color that you want the background to be, with the highlighted TEXT in the middle of the opening and closing tags. PreviewGlobal Footer<script language="javascript"> //Highlight Tags v3 //By Code Dragon //Revised By wildgoosespeeder //Global Footer //No need to edit if(!location.href.match(/action=(headersfooters|boardmodify|categorymodify|settings|membergroupmodify|modifyprofile&user=|modifycalendarentry)/)) { var td = document.getElementsByTagName("td"); var x=td.length; while(--x) { if(!document.postForm && td[x].innerHTML.match(/\[highlight=(.+?)\](.+?)\[\/highlight\]/gi) || document.postForm && (td[x].width=="100%" && td[x].className.match(/windowbg2/) && td[x].innerHTML.match(/\[highlight=(.+?)\](.+?)\[\/highlight\]/gi) && td[x].parentNode.parentNode.parentNode.cellPadding=="4" || td[x].height=="100%" && td[x].width=="80%" && td[x].vAlign=="top" && td[x].align=="left" && td[x].className.match(/windowbg(2)?/) && td[x].innerHTML.match(/\[highlight=(.+?)\](.+?)\[\/highlight\]/gi))) { td[x].innerHTML = td[x].innerHTML.replace(/\[highlight=(.+?)\](.+?)\[\/highlight\]/gi, "<span style='background-color: $1'>$2</span>"); } } } </script> 1-10-07: Fixed the problem with the postForm. 10-17-2006 5:03 PM: Fixed the highlight color problem.
|
|