jquery: siblings浣跨敤鍒犻櫎褰撳墠鏍峰紡锛屾坊鍔犳墍鏈塻iblings鏍峰紡

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jquery: siblings浣跨敤鍒犻櫎褰撳墠鏍峰紡锛屾坊鍔犳墍鏈塻iblings鏍峰紡相关的知识,希望对你有一定的参考价值。

鏍囩锛?a href='http://www.mamicode.com/so/1/esc' title='esc'>esc   query   ons   remove   script   鏍峰紡   ima   ict   test   

html:

<div class="hot-purchase">
                    <div class="title">鐑棬鍥㈣喘</div>
                    <dl class="item on">
                        <dt>
                            <a href="" class="text-area">[text]</a>
                            <a href="" class="text-name">title</a>
                            <span class="price">13000</span>
                        </dt>
                        <dd class="tag-1">
                            <span class="tag">title</span>
                            <span class="description">test</span>
                        </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>description</p>
                                <a href="">link</a>
                            </div>
                        </dd>
                    </dl>
                    <dl class="item">
                        <dt>
                            <a href="" class="text-area">[text]</a>
                            <a href="" class="text-name">title</a>
                            <span class="price">13000</span>
                        </dt>
                        <dd class="tag-1">
                            <span class="tag">title</span>
                            <span class="description">test</span>
                        </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>description</p>
                                <a href="">link</a>
                            </div>
                        </dd>
                    </dl>
                    <dl class="item">
                        <dt>
                            <a href="" class="text-area">[text]</a>
                            <a href="" class="text-name">title</a>
                            <span class="price">13000</span>
                        </dt>
                        <dd class="tag-1">
                            <span class="tag">title</span>
                            <span class="description">test</span>
                        </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>description</p>
                                <a href="">link</a>
                            </div>
                        </dd>
                    </dl>
                    <dl class="item">
                        <dt>
                            <a href="" class="text-area">[text]</a>
                            <a href="" class="text-name">title</a>
                            <span class="price">13000</span>
                        </dt>
                        <dd class="tag-1">
                            <span class="tag">title</span>
                            <span class="description">test</span>
                        </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>description</p>
                                <a href="">link</a>
                            </div>
                        </dd>
                    </dl>
                    <dl class="item">
                        <dt>
                            <a href="" class="text-area">[text]</a>
                            <a href="" class="text-name">title</a>
                            <span class="price">13000</span>
                        </dt>
                        <dd class="tag-1">
                            <span class="tag">title</span>
                            <span class="description">test</span>
                        </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>description</p>
                                <a href="">link</a>
                            </div>
                        </dd>
                    </dl>
                </div>

js: 

$(document).ready(function () {
        $(鈥?consult-right .hot-purchase .item鈥?.each(function (index) {
            $(this).hover(function () {
                $(this).addClass(鈥榦n鈥?span style="color: #000000;">);
                let siblings = $(this).siblings(鈥?item鈥?span style="color: #000000;">);
                siblings.removeClass(鈥榦n鈥?span style="color: #000000;">)
            })
        })
    })

 

以上是关于jquery: siblings浣跨敤鍒犻櫎褰撳墠鏍峰紡锛屾坊鍔犳墍鏈塻iblings鏍峰紡的主要内容,如果未能解决你的问题,请参考以下文章

璁颁竴娆#浣跨敤SQLite鐨勫潙

娴呰皥瀛樺偍杩囩▼

Beyond compare4瀵嗛挜

SQL鐨勬洿鏂板拰鍒犻櫎

WINDOS涓嬭嚜鍔ㄥ浠芥枃浠跺強鍒犻櫎涔嬪墠鐨勬枃浠?bat

javascript鍒犻櫎鏁扮粍鏌愪釜鍏冪礌