|
Post by randie on Oct 22, 2010 13:35:04 GMT -8
Wormo, is it possible to style the numbers only, on a forum?
I wish to use a font I got somewhere way back and it only affects the numbers which is good but I need to increase the size of the numbers.
Thanks!
|
|
|
Post by Wormopolis on Oct 22, 2010 17:39:35 GMT -8
the only stuff I can find on styling numbers has to do with ordered lists. what COUDL be done, is that any number a code finds in a document, could be wrapped in a special font tag that lets you set the size and face with CSS. Are you looking to do this in posts only or throughout the entire sheet?
|
|
|
Post by randie on Oct 22, 2010 18:30:15 GMT -8
Actually, the whole forum. Would settle for the main page. ;D I tried the Font Fix / Font Scaling code. Did'nt work just right. Hows Vegas? Suppose to be 38 degrees tonight in NC! Edit: Need a URL let me know. I will pm you.
|
|
|
Post by Wormopolis on Oct 23, 2010 14:56:18 GMT -8
its going to take a bit to seperate out numbers in the text fields from numbers that are part of things like URLs and font attributes, but I think I can use the engine I used in the search term highlight code to make sure ONLY text is affected.
|
|
|
Post by randie on Oct 23, 2010 18:03:37 GMT -8
Ok, I see you found the site. I guess it was you?
I'm in no hurry.
Thanks!
|
|
|
Post by Wormopolis on Nov 7, 2010 19:38:47 GMT -8
ok.. so this will seem really complex for what it does, and for right now, I only have it working in posts, but I can expand it afterwards to get it to work all over. this would be a global footer code, and it was modded from the highlight search term code I wrote
<style type="text/css"> .highlightresults {background-color:#FF0000; color: #FFFFFF;} </style>
<script type="text/javascript"> <!-- // number font change // by Wormopolis - www.wormocodes.com // v 1.0 // do not repost - keep header intact
if (pb_action=='display') { function checkChild(obj, rgxtxt) { if (obj.className && obj.className.match(/(code|highlightresults)/i)) return; if (obj.childNodes.length>1) { var ccn=obj.firstChild; while (ccn) { var nxtccn=ccn.nextSibling; checkChild(ccn, rgxtxt); ccn=nxtccn; } } else { if (obj.nodeName.match(/text/i)) { if (obj.nodeValue.match(rgxtxt)) { sp=document.createElement('span'); //shoutout to Eton for the replace hint! sp.innerHTML=obj.nodeValue.replace(rgxtxt,function (str){return '<font class="highlightresults">'+str+'</font>';}); obj.parentNode.replaceChild(sp, obj); } } else { if (obj.firstChild) checkChild(obj.firstChild, rgxtxt); } } }
for (tds=document.getElementsByTagName('td'), w=0; w<tds.length; w++) { if (tds[w].width=='80%') { for (fnt=tds[w].getElementsByTagName('font'), f=0; f<fnt.length; f++) { if (fnt[f].innerHTML.match(/\d/g)) { checkChild(fnt[f], /\d/g); } } } } } } // --> </script>
try that out in posts first. The CSS at the top will let you do whatever you want to the font tag surrounding the number, including change its font face.
|
|
|
Post by randie on Nov 14, 2010 17:06:35 GMT -8
I tried...
<style type="text/css"> .highlightresults {font-face: Digital; font-size: 25px;} </style>
The font face works. Anyway to increase the font size?
Thanks man.
|
|
|
Post by Wormopolis on Nov 14, 2010 23:30:30 GMT -8
can you PM me the link where you tested it so I can see what is holding back the font size? I suspect the outer font tag is forcing it, so I might have to somehow clear that out.
|
|
|
Post by randie on Nov 14, 2010 23:38:05 GMT -8
can you PM me the link where you tested it so I can see what is holding back the font size? I suspect the outer font tag is forcing it, so I might have to somehow clear that out. Link removed by me and sent to Wormo. ;D
|
|