- 时间:2022-10-02 06:07 编辑: 来源: 阅读:
- 扫一扫,手机访问
摘要:jquery slibings选取同级其他元素的实现代码
<script type="text/javascript">
$(function(){
$("#downloadchartsright .chartstitleopt,#downloadchartsleft .chartstitleopt").click(function(){
$(this).siblings().removeClass('underline').end().addClass('underline');
});
})
</script>
[img]http://files.jb51.net/file_images/article/201311/20131115151550.gif[/img]
比如点击“今日排名”“本周排名”“本月排名”显示底部下划线,可以通过以上jquery代码显示隐藏样式。