<div class="jjd_com-div">
<div class="pics-frame">
<div class="frame-li">
<img src="img/jjd_ban_img1.jpg" />
<a href="list-detail-1.html" class="frame-tit">什么是利息和利率?借款利息应该怎么算?</a>
<div class="fram-com"><p>利息是指因存款、放款而得到的本金以外的钱,借款人想要从借款人手里借到资金需要向出借人支付利息,利息对于出借人来说是收益。相对应的,
利率是一定时期内利息额与本金额的比率…</p>
</div>
<p class="fram-time">2017-11-13</p>
</div>
<div class="frame-li">
<img src="img/jjd_ban_img2.jpg" />
<a href="list-detail-2.html" class="frame-tit">抵押和质押有什么区别?</a>
<div class="fram-com"><p>我们日常生活中经常会听说抵押贷款,其实除了抵押,信贷行业还有一个词叫“质押”,抵押和质押有什么区别和联系呢…</p>
</div>
<p class="fram-time">2017-11-10</p>
</div>
</div>
<div class="pic-btn-div">
<div id="btn_right" class="pic-button">></div>
<div id="btn_left" class="pic-button"><</div>
</div>
</div>
pics-frame{
width: 3000px;
height: 450px;
position: relative;
}
.pics-frame .frame-li:first-child{
margin-left: 0;
}
.pics-frame .frame-li{
width: 392px;
height: 450px;
float: left;
margin-left:24px;
background: #FFFFFF;
box-shadow: 0 10px 40px 0 rgba(0,0,0,0.06);
}
.jjd_com-div.jjd_com_rig .frame-li{
width: 317px;
height: 394px;
}
.jjd_com-div.jjd_com_rig .frame-li .frame-tit{
display:block;
font-size: 18px;
color: #4D5261;
line-height: 32px;
margin: 24px 24px 16px 24px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.jjd_com-div.jjd_com_rig .frame-li p{
margin: 0 24px;
font-size: 12px;
color: #4D5261;
line-height: 24px;
}
.jjd_com-div.jjd_com_rig .frame-li img{
width: 317px;
height: 178px;
}
.pics-frame .frame-li img{
width: 392px;
height: 178px;
}
.pics-frame .frame-li p{
margin: 0 32px;
font-size: 14px;
color: #4D5261;
line-height: 24px;
}
.pics-frame .frame-li .frame-tit{
display:block;
font-size: 20px;
color: #4D5261;
line-height: 32px;
margin: 32px 32px 16px 32px;
}
.pics-frame .frame-li .fram-com{
height: 75px;
overflow: hidden;
}
.pics-frame .frame-li p.fram-time{
font-size: 14px;
color: #4D5261;
line-height: 24px;
margin-top: 28px;
}
.pic-btn-div{
width: 180px;
height: 30px;
float: right;
margin-top: 48px;
}
.pic-btn-div .pic-button{
width: 24px;
height: 24px;
background: rgba(75, 80, 95, 0.8);
background: #4B505F;
border-radius: 2px;
font-size: 16px;
line-height: 24px;
text-align: center;
color: #fff;
float: right;
margin-left: 20px;
cursor: pointer;
}
<script>
$(function() {
var liW = $(".frame-li").width()+24;
var len = $(".frame-li").length;
var ulW = len*liW
$(".pics-frame").css("width",ulW)
var index = 0
$("#btn_left").click(function() {
var lens=0;
if(len%3===0){
lens=len/3;
}else{
lens=parseInt(len/3+1);
}
index --
if(index == -1){
index = lens - 1
}
showLi(index)
})
$("#btn_right").click(function() {
var lens=0;
if(len%3===0){
lens=len/3;
}else{
lens=parseInt(len/3+1);
}
index ++
if(index == lens){
index = 0;
}
showLi(index)
})
function showLi(index){
var move = -index * liW *3;
$(".pics-frame").stop().animate({"left":move},300)
}
});
</script>
下的有点繁琐,有不懂的,不明白的可以留言给我哦