我已經嘗試過幾種幾何變體,但無法獲得嵌套div的正確選擇器。我需要爲這個div製作動畫,並且由於沒有動畫正在發生,所以我只剩下來結束我沒有抓住正確的選擇器。Jquery - 無法獲得嵌套div選擇器動畫?
這裏是我的動畫:
$(".lab1").hover(function(){
$(".panel-group .panel", this).stop(true, false).animate({ marginTop: "-80px;"}); //Trying to get this
$(".panel", this).stop(true, false).animate({ height: "140px"});
}, function() {
$("div.panel.panel-default", this).stop(true, false).animate({ marginTop: "0px;"});
$(".panel", this).stop(true, false).animate({ height: "98px" });
});
與marginTop第二行是一個沒有發生。我已經去了鉻,並試圖在那裏使用選擇器,但沒有任何工作。這是我的html:
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true" style = "text-align: left;margin-top: 30px;">
<div class="lab1"> <!--CTedit -->
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingOne">
<h4 class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="false" aria-controls="collapseOne"><i class="fa fa-plus-square-o"></i><span style="margin-left: 12px; display: inline-block;"></span>Lab Focus: Cloud Management with vRealize Operations & <nobr>vRealize Automation</nobr></a>
</h4>
</div>
我想獲得第二面板默認。我怎樣才能得到選擇器?
嘗試使用'$(本).find(「面板」。)停止....' –
沒有工作 - 我有許多東西在那裏與.panel如此表示。可能是問題。試圖找到.panel默認,但沒有工作 – skyguy