将CSS生成的图像分配给表格中的单元格,具体取决于单元格的值
问题描述:
我有css和html 在jsfiddle 。 CSS有点复杂(对我来说)。
I have the css and html here in jsfiddle. The CSS is a bit complicated (for me).
我使用没有特定ID的表。我得到他们的类名。
I'm working with tables that do not have specific IDs. I get them by getting their classname.
表中的行:
<tr class = "field_34">
<th class = "kn-label">
<span>Home</span>
</th>
<td class = "kn-value">
<span>On</span>
</td>
</tr>
我想将CSS生成的图像指定为On值。
这可以做吗?如何?
I would like to assign the CSS generated image to the "On" value. Can this be done? How?
Tim 333提供了解决方案。谢谢!证明如下:
Tim 333 gave the solution. Thank you! The proof is here:
答
我有一种工作使用jquery替换一些div为你的css使用代码:
I kind of got it working using jquery to replace the On with some divs for your css using the code:
cssimage = '<div class="button-wrap"> <div class="button-out">On</div> <div class="button-switch"></div> </div>'
$('span:contains("On")').html(cssimage);