Welcome Guest [Log In] [Register]
This board has been archived and is no longer accepting new questions. If you have a support question for your ZetaBoard, please visit us at the new support board. Registration is free and easy.


Visit the NEW ZetaBoards Support forum!

Username:   Password:
Add Reply
Highlight forum cells on mouseover
Topic Started: Feb 27 2008, 01:49 PM (1,572 Views)
RyuraGS
Member Avatar
Member
[ *  *  * ]
Preview:
http://s1.zetaboards.com/GenerationStudio/index/
Put your mouse over the box containing "General Discussion" or any other forum box :)

This one is simple. It should work anywhere, I use above the copyright.

Quote:
 
<script type="text/javascript">
// <![CDATA[
/* Highlight forum cells by GenerationStudio */
$(function() {
highlightCells = {};
highlightCells.overColor = "#ffffff";
highlightCells.offColor = "#fafafa";

$("td.c_forum").add("td.c_last:contains('a')").hover(
function() {
$(this).css("background-color",highlightCells.overColor);
}, function() {
$(this).css("background-color",highlightCells.offColor);
}).each(function(i) {
$(this).click(function() {
var a = $(this).find("a").attr("href");
window.location.href=a;
});
});
});
// ]]>
</script>

Change what is in red . overColor is the color when the mouse is on the box, offcolor is when you take the mouse of the box (it should be the original color).
Offline Profile Quote Post Goto Top
 
Nicola
Darth Vader's Sewing Instructor

Forgive me if I'm wrong, but wouldn't it be easier to do:

.c_forum:hover {
background: #fff;
}

etc
Offline Profile Quote Post Goto Top
 
RyuraGS
Member Avatar
Member
[ *  *  * ]
Nicola
Feb 27 2008, 01:56 PM
Forgive me if I'm wrong, but wouldn't it be easier to do:

.c_forum:hover {
background: #fff;
}

etc
Yes, for the hover portion. My code also allows you to click anywhere within c_forum to be taken to the link.
Offline Profile Quote Post Goto Top
 
salocin
Member
[ * ]
What would you do if you have multiple theme options?
Offline Profile Quote Post Goto Top
 
RyuraGS
Member Avatar
Member
[ *  *  * ]
salocin
Feb 27 2008, 04:47 PM
What would you do if you have multiple theme options?
Add it to Themes > Edit Theme Layout for each theme. Putting it at the end should work fine.
Offline Profile Quote Post Goto Top
 
salocin
Member
[ * ]
GenerationStudio
Feb 27 2008, 04:56 PM
salocin
Feb 27 2008, 04:47 PM
What would you do if you have multiple theme options?
Add it to Themes > Edit Theme Layout for each theme. Putting it at the end should work fine.
thank you
Offline Profile Quote Post Goto Top
 
Lanstrifer
Member
[ * ]
I like the clicking anywhere part :)
Offline Profile Quote Post Goto Top
 
Chardonnay
Member Avatar
Member
[ *  * ]
The code is great and it would be even better if the clicking would work on the second page. :)
Offline Profile Quote Post Goto Top
 
finsofafrica
Member Avatar
Member
[ *  * ]
Will this in any way result in losing ad credits?

Derek
Offline Profile Quote Post Goto Top
 
RyuraGS
Member Avatar
Member
[ *  *  * ]
finsofafrica
Apr 1 2008, 06:31 PM
Will this in any way result in losing ad credits?

Derek
No.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · User Created Codes · Next Topic »
Add Reply