单击更改背景图像

Changing background images on click

我有一个 table 和一个 header 使用 Display 标签库排序。

单击 header 时,我想从其他 header 中删除背景图像并显示 "Up Arrow" 图像。当再次点击相同的 header 时,我想要显示 "Down Arrow" 图像。

这是我现在正在使用的CSS。

CSS

th {
    height: 25px;
    border: 1px solid #EAEAEA;
}

th.sortable a:ACTIVE {
    background: url("../images/integration/downArrow.gif") no-repeat 30%;
} 

th.order1 {
    background: url("../images/integration/upArrow.gif") no-repeat 30%;
} 

我得到了解决方案,对于那些仍在努力理解这个问题的人,我感到非常抱歉。 运行 我的解决方案,您不仅会得到问题,还会得到答案。我只需要在 CSS.

中配置 order1 和 order2
th.order1 {
background: url("../images/integration/upArrow.gif") no-repeat 30%;
} 

th.order2 {
background: url("../images/integration/downArrow.gif") no-repeat 30%;
}