[Javascript] Inserting a spacer row
Troy III Ajnej
trojani2000 at hotmail.com
Sun Apr 10 13:00:29 CDT 2005
Funny, 'cause in my IE 6 browser, the red line is being displayed perfectly.
Is this some new alternative junk mail pay attention post or what.
Advertisement, not related to java-scripting are not allowed here, -thank
you.
>From: Steve Clason <stevec at topdogstrategy.com>
>Reply-To: "[JavaScript List]" <javascript at LaTech.edu>
>To: "[JavaScript List]" <javascript at LaTech.edu>
>Subject: [Javascript] Inserting a spacer row
>Date: Fri, 08 Apr 2005 09:57:50 -0600
>
>Hello,
>
>I have a script that works in Firefox but fails in Internet Explorer and
>Safari and would appreciate some help.
>
>As part of a CMS for fitness company, we've made weekly exercise schedules
>that instructors without great html skills will be maintaining. To make
>their lives easier, we wanted to insert a row with a red line above any
>table row that contained a day of the week (except Monday).
>
>Here's the script:
>
>
>function makeSpacer()
> {
> var schedule = document.getElementById("schedule");
> var cell = schedule.getElementsByTagName("td");
> for (var i=0; i<cell.length; i++)
> {
> if (cell[i].innerHTML == ("Tuesday") ||
> cell[i].innerHTML == ("Wednesday") ||
> cell[i].innerHTML == ("Thursday") ||
> cell[i].innerHTML == ("Friday") ||
> cell[i].innerHTML == ("Saturday") ||
> cell[i].innerHTML == ("Sunday"))
> {
> row = cell[i].parentNode;
> newRow = row.parentNode.insertBefore(document.createElement('tr'),
>row);
> newCell = newRow.insertCell(0);
> newCell.setAttribute("colspan", 5);
> newCell.setAttribute("class", "spacer");
> newCell.innerHTML = " ";
> i++;
> }
> }
> }
>
>And the relevant CSS:
>
>.spacer{
> height: 2px;
> background-image: url("/images/red1x2.gif");
> background-repeat: repeat-x;
> background-position: bottom;
> }
>
>I've also tried the CSS with borders and background colors with the same
>results.
>
>In Firefox I get a new row above the rows containing the days of the week.
>In Safari I get a red line only above the cell containing the day of the
>week, in Internet Explorer I get just the new row, no red line.
>
>Anyone have any suggestions? You can see a draft page at (watch the wrap):
>
>http://dev1.arieldesign.com/index.cfm?objectid=52AE2B25-D612-00A6-AA2FD44A87E48724
>
>Thanks for any help you can offer.
>--
>Steve Clason
>Web Design and Development
>Boulder, Colorado, USA
>www.topdogstrategy.com
>(303)818-8590
>
>_______________________________________________
>Javascript mailing list
>Javascript at LaTech.edu
>https://lists.LaTech.edu/mailman/listinfo/javascript
_________________________________________________________________
Don't just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/
More information about the Javascript
mailing list