|
Post by CD on Mar 28, 2005 22:06:25 GMT -8
What I need to know is, if it is possible to simply this code down to less then the 30 or so lines (didn't count or use notepad). I want to know, because it'll take quite a while to load like this, and I don't want the members of my board to wait that long. <script> var TD = document.getElementsByTagName('TD') for(t=0;t<TD.length;t++){ if(TD[t].width=="4%" && TD[t].innerHTML.match("Views")){ TD[t].style.display="none"} } for(t=0;t<TD.length;t++){ if(TD[t].width=="4%" && TD[t].innerHTML.match("Views")){ TD[t+7].style.display="none"} } for(t=0;t<TD.length;t++){ if(TD[t].width=="4%" && TD[t].innerHTML.match("Views")){ TD[t+14].style.display="none"} } for(t=0;t<TD.length;t++){ if(TD[t].width=="4%" && TD[t].innerHTML.match("Views")){ TD[t+21].style.display="none"} } for(t=0;t<TD.length;t++){ if(TD[t].width=="4%" && TD[t].innerHTML.match("Views")){ TD[t+28].style.display="none"} } for(t=0;t<TD.length;t++){ if(TD[t].width=="4%" && TD[t].innerHTML.match("Views")){ TD[t+35].style.display="none"} } for(t=0;t<TD.length;t++){ if(TD[t].width=="4%" && TD[t].innerHTML.match("Views")){ TD[t+42].style.display="none"} } for(t=0;t<TD.length;t++){ if(TD[t].width=="4%" && TD[t].innerHTML.match("Views")){ TD[t+49].style.display="none"} } for(t=0;t<TD.length;t++){ if(TD[t].width=="4%" && TD[t].innerHTML.match("Views")){ TD[t+56].style.display="none"} } for(t=0;t<TD.length;t++){ if(TD[t].width=="4%" && TD[t].innerHTML.match("Views")){ TD[t+63].style.display="none"} } for(t=0;t<TD.length;t++){ if(TD[t].width=="4%" && TD[t].innerHTML.match("Views")){ TD[t+70].style.display="none"} } for(t=0;t<TD.length;t++){ if(TD[t].width=="4%" && TD[t].innerHTML.match("Views")){ TD[t+77].style.display="none"} } for(t=0;t<TD.length;t++){ if(TD[t].width=="4%" && TD[t].innerHTML.match("Views")){ TD[t+84].style.display="none"} } for(t=0;t<TD.length;t++){ if(TD[t].width=="4%" && TD[t].innerHTML.match("Views")){ TD[t+91].style.display="none"} } for(t=0;t<TD.length;t++){ if(TD[t].width=="4%" && TD[t].innerHTML.match("Views")){ TD[t+98].style.display="none"} } for(t=0;t<TD.length;t++){ if(TD[t].width=="4%" && TD[t].innerHTML.match("Views")){ TD[t+105].style.display="none"} } for(t=0;t<TD.length;t++){ if(TD[t].width=="4%" && TD[t].innerHTML.match("Views")){ TD[t+112].style.display="none"} } for(t=0;t<TD.length;t++){ if(TD[t].width=="4%" && TD[t].innerHTML.match("Views")){ TD[t+119].style.display="none"} } for(t=0;t<TD.length;t++){ if(TD[t].width=="4%" && TD[t].innerHTML.match("Views")){ TD[t+126].style.display="none"} } for(t=0;t<TD.length;t++){ if(TD[t].width=="4%" && TD[t].innerHTML.match("Views")){ TD[t+133].style.display="none"} } for(t=0;t<TD.length;t++){ if(TD[t].width=="4%" && TD[t].innerHTML.match("Views")){ TD[t+140].style.display="none"} } </script> All the code does is remove the "Views" column from the boards page. Just want to know if anyone can help me. I am a newbie to coding javascript.
|
|
100%
|
Post by Aaron on Mar 29, 2005 14:33:01 GMT -8
Try this:
<script type="text/javascript"> <!-- var TD = document.getElementsByTagName("TD"); for(t=0;t<TD.length;t++) { if(TD[t].width=="4%" && TD[t].className.match(/catbg|windowbg/i)) { TD[t].style.display="none"; } } //--> </script>
|
|
|
Post by Marty on Mar 29, 2005 14:43:51 GMT -8
Dang! I was ready to post it, but then my computer locked up. Here's mine anyway! <script language="javascript"> <!-- if(location.href.match(/index.cgi\?board=\w+$/i)){ var td=document.getElementsByTagName('td');
for(t=0;t<td.length;t++){ if(td[t].width=="20%"){ td[t-1].style.display="none"; }}} //--> </script>
|
|
|
Post by CD on Mar 29, 2005 15:51:12 GMT -8
Tried, both, for some reason, Naruto's didn't work. >< Probably because I'm in FF.
Thanks Marty, I don't know why I didn't tihnk of doing it that way.
|
|
100%
|
Post by Aaron on Mar 29, 2005 17:53:56 GMT -8
It wasn't because of FF.. I coded it wrong, but Marty got it.
|
|
|
Post by sango028 on Jul 12, 2005 5:40:30 GMT -8
Ok, I am really super new to this and I need some help. I have a site that i have been working on and I feel that so far it is in good shape. But, with managing 3 or 4 other proboard sites, I would like each one to be different.
Ok, here is my site: [ftp]http://sango028.proboards43.com[/ftp]
I would like to add link buttons on the left side of the main page of the rest of the sites that i manage. I would like to eventually have all of them linked together but, the question is, how do i make the button links, how can i change colors of them to personalize them per site, and I am stupid.
Could you please help me with this?
Sango
Note* - the site might be girly, but I hate the color. But, I think that it looks right with the pic. What you think?
|
|
|
Post by CD on Jul 12, 2005 10:11:14 GMT -8
Could you create your own thread, and try to be more specific? x.X This thread is really old.
|
|