jquery结合animate.css 动画效果的实现
2017-12-27 15:10
986 查看
本案例是在bootstrap下的实验环境,
html代码
<li class="thumbnail col-md-2">
<a href="{$val['url']}">
<img src="{$val['thumb']}" alt="{$val['title']}">
</a>
<div class="caption">
<h2 class="h4"><a href="{$val['url']}">{$val['title']}</a><span class="pull-right">{number_format($val[weekviews])} <span class="glyphicon glyphicon-heart"></span></span></h2>
</div>
<a class="ccc" href="{$val['url']}">
{$val[dion]}
</a>
</li>
css
.thumbnail{
overflow: hidden;
}
.thumbnail .ccc{
position: absolute;
top:0;
left:0;
width: 100%;
height: 100%;
padding:8%;
color: aliceblue;
display: none;
background:rgb(86, 84, 84);
filter:Alpha(opacity=81);
background: rgba(86, 84, 84, 0.81);
}
js
$(document).on({
'mouseenter':function(){
console.log(1)
$(this).find('.ccc').finish().removeClass('lightSpeedOut').show().addClass('animated lightSpeedIn');
},
'mouseleave':function(){
console.log(2)
$(this).find('.ccc').finish().removeClass('lightSpeedIn').addClass('lightSpeedOut').delay(1000).hide('');
}
},'.thumbnail');为了向下兼容,只好加个delay了
html代码
<li class="thumbnail col-md-2">
<a href="{$val['url']}">
<img src="{$val['thumb']}" alt="{$val['title']}">
</a>
<div class="caption">
<h2 class="h4"><a href="{$val['url']}">{$val['title']}</a><span class="pull-right">{number_format($val[weekviews])} <span class="glyphicon glyphicon-heart"></span></span></h2>
</div>
<a class="ccc" href="{$val['url']}">
{$val[dion]}
</a>
</li>
css
.thumbnail{
overflow: hidden;
}
.thumbnail .ccc{
position: absolute;
top:0;
left:0;
width: 100%;
height: 100%;
padding:8%;
color: aliceblue;
display: none;
background:rgb(86, 84, 84);
filter:Alpha(opacity=81);
background: rgba(86, 84, 84, 0.81);
}
js
$(document).on({
'mouseenter':function(){
console.log(1)
$(this).find('.ccc').finish().removeClass('lightSpeedOut').show().addClass('animated lightSpeedIn');
},
'mouseleave':function(){
console.log(2)
$(this).find('.ccc').finish().removeClass('lightSpeedIn').addClass('lightSpeedOut').delay(1000).hide('');
}
},'.thumbnail');为了向下兼容,只好加个delay了
相关文章推荐
- 用js实现类似jquery里的animate动画效果
- jQuery动画效果animate和scrollTop结合使用实例
- jQuery动画效果animate和scrollTop结合使用实例
- 10个CSS和jQuery的加载中(loading)动画效果实现
- CSS、jQuery实现放大缩小动画效果
- jQuery动画效果animate和scrollTop结合使用实例
- jQuery中animate()动画效果的实现
- Jquery使用animate实现css3的transform动画效果
- jQuery动画效果animate和scrollTop结合使用实例
- jQuery动画效果animate和scrollTop结合使用实例
- CSS+jQuery实现的一个放大缩小动画效果
- jquery的animate动画效果函数用JS代码是如何实现的
- trick:CSS 3+checkbox实现JQuery的6个基本动画效果
- jQuery动画效果animate和scrollTop结合使用实例
- Jquery结合div+css实现文字间断停顿向上滚动效果
- 利用jQuery的动画函数animate实现豌豆发射效果
- js、jquery和css 3中的动画实现效果
- CSS3结合jQuery实现动画效果及回调函数的实例
- CSS+jQuery实现的一个放大缩小动画效果
- 用js实现类似jquery里的animate动画效果