사용자가 마우스를 가져갈 때 특정 div가 확장되기를 원합니다.jquery에서 div 내부의 요소에 액세스하여 exanding div를 투명하게 만드는 방법
<td><h4>Like Football</h4></td>
div 태그 내부의 요소에 액세스하는 방법이 불분명합니다. 또한 확장 div의 배경이 Fifa 12가 표시되는 this website 에서처럼 특정 정도까지 투명 해지기를 바랍니다. 도와주세요.
<div>
<a href="">
<img src="images/fifa.jpg" /></a>
</div>
<div class="wrapper">
<table>
<tr>
<td>
<img src="images/arrow.jpg" height="28" width="28"/ >
</td>
<td>
<h4>Like Football</h4>
</td>
</tr>
</table>
<div class="wrapperhover">
<p class="wrappercontent" id="p">
<span>Download FIFA 12 on Xperia™!</span>
<a href="" onclick=""><span>Find more</span></a>
</p>
</div>
</div>
CSS
.wrapper
{
background-color:Black;
color:White;
width:245px;
height:100px;
margin-top:-100px;
position:absolute;
}
.wrapperhover
{
height:100px;
}
JQUERY
$ (문서) .ready (함수() {나는 바이올린 here을했습니다
$(".wrapperhover").hide();
$(".wrapper").hover(function() {
$(".wrapperhover").show();
var contentHeight = 0;
$(this).children().each(function() {
contentHeight += $(this).height();
});
$(this).animate({
height: '150px',
marginTop: "-150"
}, 300);
}, function() {
$(this).animate({
height: '100px', marginTop: "-100"
}, 300);
$(".wrapperhover").hide();
});
});
http://jsfiddle.net을 사용하여 코드의 실제 예제를 만듭니다. 그것이 그렇듯이 사람들은 심하게 들여 쓰여진 HTML 벽에 감사를 표합니다. – egasimus
질문이 명확하지 않습니다. '$()'의 요소는 CSS에서 접근하는 것과 같은 방법으로 접근 할 수 있으며'$ ('...') .css ('background-color', 'transparent'); – ori