vue+jQuery制作图片变大缩小,文字内容结合滑动手风琴动画特效
vue+jQuery制作图片变大缩小,文字内容结合滑动手风琴动画特

html:
<section class="main_box">
<div class="box" id="app">
<ul>
<li :class="li.class" v-for="li in data">
<a :href="li.href" target="_blank">
<h3>{{li.name}}</h3>
<p>{{li.text}}</p>
<img :src="li.src" alt="img">
</a>
</li>
<div style="clear: both"></div>
</ul>
</div>
</section>css:
body{
margin: 0;
padding: 0;
}
ul{
margin: 0;
padding: 0;
list-style: none;
}
a{
text-decoration: none;
}
h3, p{
margin: 0;
font-weight: normal;
}
.main_box{
width: 100%;
position: relative;
}
.box{
width: 1232px;
margin: 10px auto;
padding: 15px;
}
.box_ul_li{
width: 202px;
height: 300px;
box-shadow: 3px 2px 30px rgba(0, 0, 0, 0.1);
float: left;
text-align: center;
position: relative;
transition: all 0.6s ease-out;
}
.box ul li h3{
padding-top: 30px;
color: #333;
font-size: 18px;
}
.box ul li p{
margin-top: 7px;
color: #666;
font-size: 14px;
}
.box ul li img{
width: 150px;
position: absolute;
right: 26px;
bottom: 40px;
transition: all 0.6s ease-out;
}
.box ul .on{
width: 402px;
height: 400px;
background-color: #6ab0e8;
text-align: left;
}
.box ul .on h3{
padding-left: 20px;
color: #FFF;
}
.box ul .on p{
margin-left: 20px;
color: #FFF;
}
.box ul .on img{
width: 382px;
position: absolute;
right: 8px;
bottom: 10px;
border: 2px solid #f1f1f1;
}vuejs+jq:
var vm = new Vue({
el: "#app",
data: function () {
return {
data:[
{class:"box_ul_li",href:"#",src:"img/1.jpg",name:"别墅软装 ",text:"别墅软装设计比较容易犯什么错误 "},
{class:"box_ul_li on",href:"#",src:"img/2.jpg",name:"别墅设计公司",text:"别墅设计公司装修别墅时要注意哪些事项?..."},
{class:"box_ul_li",href:"#",src:"img/3.jpg",name:"徽派建筑",text:"徽派建筑的特点在这里"},
{class:"box_ul_li",href:"#",src:"img/4.jpg",name:"徽派古建筑 ",text:"徽派古建筑有什么样的工艺特征 "},
{class:"box_ul_li",href:"#",src:"img/5.jpg",name:"徽派建筑",text:"徽派建筑可以给大家带来清新天然的气息.."},
]
}
}
});
$(".box ul li").hover(function(){
$(this).addClass('on').siblings().removeClass('on');
});
吐槽一下


还没有留言,还不快点抢沙发?