css - Refresh an elements style in Javascript -


I have a table that has the rows dynamically loaded from the record set. I have also used javascript, when a checkbox (not in the table) is checked, this column hides all the lines of x = y, but I have a vertical border (actually just a background image that is right Which is the last line in the table using css .sortable .dynamicrow: last-child TD {

So when I look at the box and the last one line Is removed, then si Interpretation "I basically to fade properly CSS must resume / refresh.

In all I am asking how to refresh the style / CSS of an element in javascript.

 . .dynamicrow: last-baby td {background-image: url (../images / tablewibrarybottom page); Background position: OK, repeat background: do not repeat; }  

Whether the CSS I used to fade the vertical border on the previous row, sometimes the last row is deleted, so the second last line becomes the last line, but it It has a solid border and it does not fade.

After the page is placed, JavaScript can also be applied that sometimes the last child is removed, so the child above it becomes the last child, how do I get the above CSS Can I apply to the new final child?

What I would do is add a class to declare your current style, and hide the last line now on CSS Apply the square to the last line.

 .sortable .dynamico: last-child TD, .dummy_last_row {background-image: url (.. /Images/tablevborderbottom.png); Background position: OK, repeat background: do not repeat; } 

Then Javascript is based on a simple table, with 1 row, 1 TD

 function with the onclick = "Lst_row (this)" Lst_row (line) {Row = row.parentNode.parentNode; Tbl = document.getElementById ("sort"); Line = tbl.getElementsByTagName ("TR"); If (line == rows [tbl.getElementsByTagName ("TR"). Length -1] || row.className.indexOf ("dummy_last_row") = -1) {for (i = 0; i & lt; rows.length ; I ++) {if (i! = 0 && Row == rows [i] and & rows [i-1]) {rows [i-1] .className + = "dummy_last_row"; }}}} 

This is absolutely simple, but the basis is.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -