<div class="project-card even" @click="project(1)"> <p class="project-name">project2</p> <div class="project-content"> <p>xxxxxxxxxxxxxxxxxxxxx</p> <span @click="closeProject(1)">返回</span> </div></div>
closeProject:function (index) { $('.project-card').eq(index).css({ 'height':'100px', }) console.log($('.project-card').eq(index).css('height')) }, project:function (index) { $('.project-card').eq(index).css({ 'height':'100%' }) $('.scroll').animate({ scrollTop:document.getElementsByClassName('project-card')[index].offsetTop }); },
代码如上,closeProject方法无法修改height高度为100px,为什么?,打印出的高度还是为原来的高度
慕田峪7331174
largeQ