Advertise Here

Author Topic: [Code] Board Cell Highlight  (Read 1823 times)

0 Members and 1 Guest are viewing this topic.

Offline Peter

  • SMF For Free Newbie
  • *
  • Posts: 5
    • View Profile

  • Total Badges: 10
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 First Post
[Code] Board Cell Highlight
« on: January 28, 2007, 12:24:41 pm »
This code will change the background colour of the board cell (cell that has the board link and description in) when you hover over it.  Also if you click on the cell it will take you to that board.

Look for this line in the top of the code and change the colour in bold to the colour you want...

var highlight_color = "#ECEDF3";

Place the code into your footer.

Code: [Select]
<script type="text/javascript">
<!--

// Highlight color here

var highlight_color = "#ECEDF3";

var highlight = {

init: function(){
var cell = document.getElementsByTagName("td");

for(c = 0; c < cell.length; c ++){
if(cell.item(c).className == "windowbg2" && cell.item(c).getElementsByTagName("a").item(0)){
var link = cell.item(c).getElementsByTagName("a").item(0);

if(link.href.match(/board,\d+\./i) && link.name.match(/^b\d+/i)){
cell.item(c).onmouseover = function(){
this.style.cursor = "pointer";
this.style.backgroundColor = highlight_color;
}

cell.item(c).onmouseout = function(){
this.style.cursor = "";
this.style.backgroundColor = "";
}

cell.item(c).onclick = function(){
location.href = this.getElementsByTagName("a").item(0).href;
}
}
}
}
}
}

highlight.init();

//-->
</script>
« Last Edit: April 23, 2008, 02:16:46 pm by Agent Moose »

Offline x-Treme

  • SMF For Free Hero
  • *
  • Posts: 592
  • formally known as Gordie!!!
    • View Profile
    • xTreme Arcade

  • Total Badges: 19
    Badges: (View All)
    Topic Starter Combination Level 4 Level 3 Level 2
Re: Board Cell Highlight
« Reply #1 on: October 10, 2007, 08:00:57 am »
Why can't I get this to work on my server1 forum,but works on the other 2 servers?Anyone know why?I even removed all other codes from my footer and still nothing.

Offline Mary

  • SMF For Free Sr. Member
  • *
  • Posts: 434
    • View Profile
    • PogoJustPogo

  • Total Badges: 15
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: Board Cell Highlight
« Reply #2 on: October 10, 2007, 08:07:36 am »
Is there a preview of this?
Vist us at www.pogojustpogo.smfforfree3.com
Best and Friendliest Pogo FanSite There Is!!

Offline x-Treme

  • SMF For Free Hero
  • *
  • Posts: 592
  • formally known as Gordie!!!
    • View Profile
    • xTreme Arcade

  • Total Badges: 19
    Badges: (View All)
    Topic Starter Combination Level 4 Level 3 Level 2
Re: Board Cell Highlight
« Reply #3 on: October 10, 2007, 08:18:50 am »

 

Related Topics

  Subject / Started by Replies Last post
50 Replies
12956 Views
Last post July 30, 2007, 09:58:16 am
by Agent Moose
27 Replies
6659 Views
Last post August 02, 2008, 08:20:37 am
by Suki The Saluki
1 Replies
874 Views
Last post December 16, 2007, 12:37:51 pm
by {]-=®áw®=-[}
0 Replies
1267 Views
Last post March 21, 2009, 09:27:14 am
by Josh5552
2 Replies
1140 Views
Last post February 26, 2018, 04:59:26 pm
by Lynn1