我想根据特定的切换面板更改切换箭头图像
根据点击我想在向右和向下箭头之间切换
CSS:-
.icon
{
height:14px;
width:14px;
float:left;
position:relative;
margin-right:10px;
background:url("http://glyphicons.com/wp- content/themes/glyphicons/images/glyphicons_halflings.png") no-repeat;
}
.icon-rightarrow
{
background-position:-456px -72px;
}
.icon-downarrow
{
background-position:-313px -119px;
}
最佳答案
您可以使用 AddClass 来做到这一点和 RemoveClass功能。
以下将右箭头更改为向下箭头:
$("#MyElementId").removeClass("icon-rightarrow");
$("#MyElementId").addClass("icon-downarrow");
关于jquery - 切换箭头图像更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14934897/