0
jquery 플러그인 dotdotdot을 사용하여 텍스트 블록 뒤에 '... 자세히 알아보기 >>'를 만듭니다. 사용자가 링크 ('자세히 >> >>')를 클릭하면 전체 텍스트가 보이도록 div가 확장되어야합니다. 첫 번째 부분은 훌륭하지만 두 번째 부분은 알 수 없습니다.부모 높이를 어린이 높이로 변경하십시오.
<script type="text/javascript" language="javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" language="javascript" src="js/jquery.dotdotdot.min.js"></script>
<script type="text/javascript" language="javascript">
$(function() {
$('#dot3').dotdotdot({
after: 'a#test'
});
});
<style type="text/css" media="all">
div.example {
padding: 0 0 150px 0;
}
div.example:after {
content: '';
display: block;
clear: both;
}
div.r {
width: 275px;
}
div.box {
border: 1px solid #ccc;
height: 160px;
padding: 15px 20px 10px 20px;
overflow:visible;
}
</style>
<div class="example">
<div class="r">
<div class="box after" id="dot3">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
<a href="#" id="test" onClick="">Read more »</a></div>
</div>
</div>
, 사업부 확장하려고 ? 제목을 좀더 자세히 설명 할 수 있습니까? – Chris
lorem 텍스트는 'Lorem ips ... Read More >>'와 같이 표시됩니다. 이것은 dotdotdot 플러그인과 CSS 설정에 의해 수행됩니다. 더 자세히 >> 링크를 클릭하면 전체 텍스트가 표시됩니다. div.box의 높이를 자동으로 변경하려고했지만 작동하지 않습니다. –