分类项点击刷新后如何更改该项的CSS样式?
想要点击后样式变红其他不变,但是点击后链接要和后台数据交换,完成后会刷新界面,于是又变成了指定默认项是红的,此时后台的数据已经交换成功,前台的样式跟不上节奏了,这个应该怎...
想要点击后样式变红 其他不变,但是点击后链接要和后台数据交换,完成后会刷新界面,于是又变成了指定默认项是红的,此时后台的数据已经交换成功,前台的样式跟不上节奏了,这个应该怎么改?
<div class="frow" id ="frow">
<p class="frow order" id="frow_order">排列方式:
<span class="frow_order_span frow_order_current"><span>时间↓</span><a href="#">时间↓</a> </span>
<span class="frow_order_span"><span>浏览次数↓</span><a href="#">浏览次数↓</a> </span>
<span class="frow_order_span"><span>评论分数↓</span><a href="#">评论分数↓</a></span></p></div>
<style>
#frow_order{font-size:14px;}
.frow_order_span{position:relative;}
.frow_order_span a{position:absolute;z-index:100;left:-28px;top:0;opacity:0;filter:Alpha(opacity=0);}
.frow_order_current{color:red;}
</style>
<script src="jquery.js"></script>
<script>
$("#frow_order span").click(function(){
$(this).addClass("frow_order_current").siblings().removeClass("frow_order_current");
});
</script> 展开
<div class="frow" id ="frow">
<p class="frow order" id="frow_order">排列方式:
<span class="frow_order_span frow_order_current"><span>时间↓</span><a href="#">时间↓</a> </span>
<span class="frow_order_span"><span>浏览次数↓</span><a href="#">浏览次数↓</a> </span>
<span class="frow_order_span"><span>评论分数↓</span><a href="#">评论分数↓</a></span></p></div>
<style>
#frow_order{font-size:14px;}
.frow_order_span{position:relative;}
.frow_order_span a{position:absolute;z-index:100;left:-28px;top:0;opacity:0;filter:Alpha(opacity=0);}
.frow_order_current{color:red;}
</style>
<script src="jquery.js"></script>
<script>
$("#frow_order span").click(function(){
$(this).addClass("frow_order_current").siblings().removeClass("frow_order_current");
});
</script> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询