Post by SubDevo on May 12, 2010 20:50:18 GMT -8
On-Off Icon - Cell Style, Title Fix and Clickable by SubDevo
Tested in IE, FF, Opera, Safari and Chrome.
This code affects the "On/Off" icons on the main page and sub-boards on the thread list page of your forum.
Enjoy!!!
SubDevo
Only one line to edit:
var nCell="background-color: #FF0000"; // Cell CSS Style. (Empty "" disables.)
Enter any CSS style you want for the cell behind the "On/Off" Icon.
Use regular CSS syntax in the above. Use a background image, color, borders etc.
Set this to empty, "" to NOT change the cell style.
Note:
This code does NOT change the classname of "windowbg" for the cell.
Therefore, other codes are not affected that need to find the classname of "windowbg" in order to work.
Location: Global Footer
<script type="text/javascript">
/* On-Off Icon - Cell Style, Title Fix and Clickable by SubDevo */
/* Global Footer - Please leave this header intact. Do not repost. */
/* interoceandesigns.com or lsdp.proboards.com */
var nCell="background-color: #FF0000"; // Cell CSS Style. (Empty "" disables.)
if(/^(home|boardindex)$/.test(pb_action)){ var n=document.images,a,b,x=-1;
while(n[++x]){a=n[x];
if(/\[(\*)|\s\]/.test(a.alt)){ if(nCell){a.parentNode.style.cssText=nCell;}
a.title=((RegExp.$1)?" ":" No ")+"New Posts ";
a=a.parentNode; b=a.parentNode.lastChild.firstChild;
if(/thread=/i.test(b.innerHTML)){
a.innerHTML="<a href='"+b.lastChild.href.replace(/=display/i,"=gotonewpost")+"' >"+a.innerHTML+"</a>";
}}}}
</script>
2/2/11 EDIT:
Code changed to NOT change the alt attribute, only the title attribute.
This is so other codes looking for the original alt will function normally.
Tested in IE, FF, Opera, Safari and Chrome.
This code affects the "On/Off" icons on the main page and sub-boards on the thread list page of your forum.
- Makes the icon clickable. It links to the latest post in that board.
- Gives hover text for all browser users. (No/New Posts)
- Style the cell that is behind the "On/Off" icon with CSS. (optional)
Enjoy!!!
SubDevo
Only one line to edit:
var nCell="background-color: #FF0000"; // Cell CSS Style. (Empty "" disables.)
Enter any CSS style you want for the cell behind the "On/Off" Icon.
Use regular CSS syntax in the above. Use a background image, color, borders etc.
Set this to empty, "" to NOT change the cell style.
Note:
This code does NOT change the classname of "windowbg" for the cell.
Therefore, other codes are not affected that need to find the classname of "windowbg" in order to work.
Location: Global Footer
<script type="text/javascript">
/* On-Off Icon - Cell Style, Title Fix and Clickable by SubDevo */
/* Global Footer - Please leave this header intact. Do not repost. */
/* interoceandesigns.com or lsdp.proboards.com */
var nCell="background-color: #FF0000"; // Cell CSS Style. (Empty "" disables.)
if(/^(home|boardindex)$/.test(pb_action)){ var n=document.images,a,b,x=-1;
while(n[++x]){a=n[x];
if(/\[(\*)|\s\]/.test(a.alt)){ if(nCell){a.parentNode.style.cssText=nCell;}
a.title=((RegExp.$1)?" ":" No ")+"New Posts ";
a=a.parentNode; b=a.parentNode.lastChild.firstChild;
if(/thread=/i.test(b.innerHTML)){
a.innerHTML="<a href='"+b.lastChild.href.replace(/=display/i,"=gotonewpost")+"' >"+a.innerHTML+"</a>";
}}}}
</script>
2/2/11 EDIT:
Code changed to NOT change the alt attribute, only the title attribute.
This is so other codes looking for the original alt will function normally.