jquery: siblings使用删除当前样式,添加所有siblings样式
2021-02-02 17:13
标签:esc query ons remove script 样式 ima ict test html: js: jquery: siblings使用删除当前样式,添加所有siblings样式 标签:esc query ons remove script 样式 ima ict test 原文地址:https://www.cnblogs.com/Nyan-Workflow-FC/p/13168176.htmldiv class="hot-purchase">
div class="title">热门团购div>
dl class="item on">
dt>
a href="" class="text-area">[text]a>
a href="" class="text-name">titlea>
span class="price">13000span>
dt>
dd class="tag-1">
span class="tag">titlespan>
span class="description">testspan>
dd>
dd class="tag-2 clearfix">
div class="picture-left fl">
a href="">img src="../images/consult_hot_purchase.jpg" alt="">a>
div>
div class="content-right fl">
p>descriptionp>
a href="">linka>
div>
dd>
dl>
dl class="item">
dt>
a href="" class="text-area">[text]a>
a href="" class="text-name">titlea>
span class="price">13000span>
dt>
dd class="tag-1">
span class="tag">titlespan>
span class="description">testspan>
dd>
dd class="tag-2 clearfix">
div class="picture-left fl">
a href="">img src="../images/consult_hot_purchase.jpg" alt="">a>
div>
div class="content-right fl">
p>descriptionp>
a href="">linka>
div>
dd>
dl>
dl class="item">
dt>
a href="" class="text-area">[text]a>
a href="" class="text-name">titlea>
span class="price">13000span>
dt>
dd class="tag-1">
span class="tag">titlespan>
span class="description">testspan>
dd>
dd class="tag-2 clearfix">
div class="picture-left fl">
a href="">img src="../images/consult_hot_purchase.jpg" alt="">a>
div>
div class="content-right fl">
p>descriptionp>
a href="">linka>
div>
dd>
dl>
dl class="item">
dt>
a href="" class="text-area">[text]a>
a href="" class="text-name">titlea>
span class="price">13000span>
dt>
dd class="tag-1">
span class="tag">titlespan>
span class="description">testspan>
dd>
dd class="tag-2 clearfix">
div class="picture-left fl">
a href="">img src="../images/consult_hot_purchase.jpg" alt="">a>
div>
div class="content-right fl">
p>descriptionp>
a href="">linka>
div>
dd>
dl>
dl class="item">
dt>
a href="" class="text-area">[text]a>
a href="" class="text-name">titlea>
span class="price">13000span>
dt>
dd class="tag-1">
span class="tag">titlespan>
span class="description">testspan>
dd>
dd class="tag-2 clearfix">
div class="picture-left fl">
a href="">img src="../images/consult_hot_purchase.jpg" alt="">a>
div>
div class="content-right fl">
p>descriptionp>
a href="">linka>
div>
dd>
dl>
div>
$(document).ready(function () {
$(‘.consult-right .hot-purchase .item‘).each(function (index) {
$(this).hover(function () {
$(this).addClass(‘on‘);
let siblings = $(this).siblings(‘.item‘);
siblings.removeClass(‘on‘)
})
})
})
上一篇:apache配置文件说明
文章标题:jquery: siblings使用删除当前样式,添加所有siblings样式
文章链接:http://soscw.com/index.php/essay/50052.html