Auburn
Not New Member
Posts: 34
Auburn said 0 great things
|
Post by Auburn on Jul 1, 2010 11:18:12 GMT -8
Hi! ^^
I'm back again and just need a little help with changing the background color of the miniprofiles. I'm horrible at javascript, but I think the code above has the basic structure? It's a code Jodran made that changes the miniprofile's display names.
<script type="text/javascript"> <!--
if(location.href.match(/(display|viewprofile|calendar|pmview|recent$)/)|| location.href.match(/index.cgi$/) && document.title.match(/(Preview|Search)/)){ for(var td=document.getElementsByTagName("td"), x= 6; x<td.length; x++){ if(td[x].width == "20%"){
var a = td[x].getElementsByTagName("a"), b = a.length, c = 0;
while(c < b){ if(a[c].className && a[c].className.match(/group/i)){ a[c].style.fontSize = "20px"; a[c].style.fontFamily = "verdana"; a[c].style.fontWeight = "normal"; break; } c++; } } } }
//--> </script>
So I kinda tried to do it myself <.< because I don't like bugging others for codes.. but failed. This is my failed attempt:
<script type="text/javascript"> <!--
if(location.href.match(/(display|viewprofile|calendar|pmview|recent$)/)|| location.href.match(/index.cgi$/) && document.title.match(/(Preview|Search)/)){ for(var td=document.getElementsByTagName("td"), x= 6; x<td.length; x++){ if(td[x].width == "20%"){ td[x].style.backgroundColor="000000"; } c++; } } } }
//--> </script>
..i suck. v,v
help? ^^;
|
|
|
Post by Wormopolis on Jul 1, 2010 22:29:23 GMT -8
<script type="text/javascript"> <!-- // mp background color force
if (pb_action.match(/display|search2|recent/)) { for (tds=document.getElementsByTagName('td'), x=0; x<tds.length; x++) { if (tds[x].width=='20%' && tds[x].className.match(/windowbg/) && tds[x].vAlign=='top') { tds[x].style.backgroundColor="000000"; } } } // --> </script>
|
|
Auburn
Not New Member
Posts: 34
Auburn said 0 great things
|
Post by Auburn on Jul 2, 2010 5:04:27 GMT -8
yay! thank you! ^^
(um.. what was I doing wrong? <<)
|
|
|
Post by Wormopolis on Jul 2, 2010 5:39:42 GMT -8
the biggest problem was you had too many closing } brackets to match up with opening ones {
I would also be a bit more specific when finding cells. leaving it at width=20% can include a lot of other possible cells. find more things to set the target cell apart.
|
|
Auburn
Not New Member
Posts: 34
Auburn said 0 great things
|
Post by Auburn on Jul 2, 2010 18:48:21 GMT -8
I see. *will keep that in mind*
|
|