Category in a table and cells
Posted: 21 October 2004 09:54 AM   [ Ignore ]  
Grad Student
Rank
Total Posts:  59
Joined  01-07-2003

Hi

I am trying to display my category items in a table cells, and it would be great if I can get the cells to change bgcolor on mouseover.

I my humble openion, a good menu system is the only missing thing for EE to be perfect smile

Profile
 
 
Posted: 21 October 2004 10:36 AM   [ Ignore ]   [ # 1 ]  
Grad Student
Rank
Total Posts:  59
Joined  01-07-2003

Shortly after my post, I found a thread that explain how to display category items in a table cells.

But I still have not figur out how to change cell color on mousover smile

Thanks

Profile
 
 
Posted: 21 October 2004 12:17 PM   [ Ignore ]   [ # 2 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  9853
Joined  06-19-2002

Changing color on mouseover is something you can do with CSS.  Modern browsers will allow you to specify a “hover” state for any element you want, which includes a table cell.  Unfortunately, IE6 isn’t one of these modern browsers.  To get it to work in IE6 you’ll probably have to resort to javascript.

 Signature 

Chris Curtis
chriscurtis.org

Profile
 
 
Posted: 21 October 2004 11:10 PM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  831
Joined  04-24-2002

Yet another reason to despise IE…

As Chris said, to make it work in IE6, you’d have to use JavaScript onmouseover’s/onmouseout’s for each cell.  Your function would then change the style.  Something like:


<script type=“text/javascript” language=“javascript1.2”>
// <![CDATA[
function hilite(id) {
document.getElementById(id).style.backgroundColor = ‘#3F0’;
}

function lolite(id) {
document.getElementById(id).style.backgroundColor = ‘#FFF’;
}
// ]]>
</script>

<table>
<tr>
<td id=“thing1” onmouseover=“hilite(‘thing1’)” onmouseout=“lolite(‘thing1’)”>Thing1</td>
<td id=“thing2” onmouseover=“hilite(‘thing2’)” onmouseout=“lolite(‘thing2’)”>Thing2</td>
<td id=“thing3” onmouseover=“hilite(‘thing3’)” onmouseout=“lolite(‘thing3’)”>Thing3</td>
<td id=“thing4” onmouseover=“hilite(‘thing4’)” onmouseout=“lolite(‘thing4’)”>Thing4</td>
</tr>
</table>

I’m sure there are other ways to approach this with JavaScript, but this was off the top of my head.

 Signature 

chrisruzin.netTextMate EE BundleTextMate EE Developer BundleSolspace
“The greatest barrier to success is the fear of failure.” - Sven Goran Eriksson

Profile
 
 
Posted: 22 October 2004 09:44 AM   [ Ignore ]   [ # 4 ]  
Grad Student
Rank
Total Posts:  59
Joined  01-07-2003

thank you very much, this is what I was looking for smile

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 66392 Total Logged-in Users: 26
Total Topics: 84718 Total Anonymous Users: 17
Total Replies: 454704 Total Guests: 180
Total Posts: 539422    
Members ( View Memberlist )