Alternate Row MouseOver Color

28599 Users read it.
by Marcellino Bommezijn (October 9, 2001)
This tutorial will show you how to use CSS/JS/VB in combination with a repeated region to make your view dynamic even more.

User Rating (77 votes)
2 reviews available | Read the reviews »
User Level:Beginner
Product:Dreamweaver 3, Dreamweaver 4, Dreamweaver MX, Dreamweaver MX 2004, UltraDev 1, UltraDev 4
Server Model:ASP VBScript
Browser:All
Technologies:CSS, JavaScript

Advanced Alternate MouseOver Row Color

This tutorial will show you how to make use of your CSS and JavaScript to create a advanced alternate row mouseover row color within your repeat region based on the Alternate Row Color code from UltraDeviant.

First of all we are going to create a repeated region as you normally do within Ultradev on a RecordSet (no explaination needed !).

The idea is to create some classes in your CSS that are going to used to set your alternate row color and the mouseover color.

First we set the link, link hover style and table style (can be anything):

A {
font-size : 10pt;
font-family : Arial, sans-serif;
color : #004080;
}
A:hover {
font-size : 10pt;
font-family : Arial, sans-serif;
color : #FFFFFF;
}
TABLE {
font-family: Arial, sans-serif;
font-size: 10pt;
color: #000000;
}

Second we create 3 classes:

  • class for the odd tablerows
  • class for the even table rows
  • class for the selected table row (mouseover)

Class for the odd rows:

TR.RowOverOdd {
background-color : #FCFCFC;
}

Class for the even rows:

TR.RowOverEven {
background-color : #CFCFCF;
}

Class for the selected row:

TR.RowOverSelected {
color : #FFFFFF;
background-color : #8080FF;
}

So we now have the following CSS styles defined:

A {
font-size : 10pt;
font-family : Arial, sans-serif;
color : #004080;
}
A:hover {
font-size : 10pt;
font-family : Arial, sans-serif;
color : #FFFFFF;
}
TABLE {
font-family: Arial, sans-serif;
font-size: 10pt;
color: #000000;
}
TR.RowOverOdd {
background-color : #FCFCFC;
}
TR.RowOverEven {
background-color : #CFCFCF;
}
TR.RowOverSelected {
color : #FFFFFF;
background-color : #8080FF;
}

 

Next Page >>

 

Marcellino Bommezijn

Marcellino BommezijnMarcellino Bommezijn is one of the managers at dmxzone.com. He is a contributor on the tutorials section.

Owner of Senzes Media (http://www.activecontent.nl) which provides professional services and web applications for mid-sized companies.

ActiveContent CMS is the ASP.NET Content Management solution that is used for building professional and rich-featured websites.

See All Postings From Marcellino Bommezijn >>

User Reviews

Total of 2 reviews
RE: Dynamic data
Written by Marcellino Bommezijn on March 2, 2002

Why not try it and see if it does and let us know if things work out. Good luck

Dynamic data
Written by Ken Jasmin on March 1, 2002

Would this work with dynamic data?

Follow us on twitter Subscribe to our RSS feed
Activate your free membership today | Login | Currency