简体   繁体   English

弹出效果对图像的影响

[英]Flyout effect on image

here is the link http://t3n.de/news/billig-rechner-intel-compute-stick-587589/ 这是链接http://t3n.de/news/billig-rechner-intel-compute-stick-587589/

On left-side bottom-line of this page,there is a image like envelope. 在此页面的左侧底行上,有一个像信封的图像。 When you do hover on this image,the image is flyout. 当您将鼠标悬停在此图像上时,该图像将弹出。 I am not sure what is called this effect? 我不确定这叫什么效果? Actually i need this effect in project. 实际上我在项目中需要这种效果。 How can i do that? 我怎样才能做到这一点?

Please see this - which doesn't need to use jquery - just pure css! 请查看此内容 -无需使用jquery-仅使用纯CSS!

But below is a simple example of what i think you're looking to achieve: 但是下面是我达到的简单示例:

 img{ margin-top:50px; /*for demo purposes*/ margin-left:50px; /*for demo purposes*/ transition: all 0.8s; } img:hover{ transform:scale(1.8); transform-origin: center bottom; } 
 <img src="http://placekitten.com/g/60/40" alt=""/> 

For vendor prefixes/compatibility, please click here 有关供应商前缀/兼容性,请单击此处

In jQuery you can do it like this: 在jQuery中,您可以这样做:

$('.flyout').on('mouseenter', function(){
    $(this).animate({
        bottom: '0px'
    }); 
});

CSS: CSS:

.flyout{
    position: fixed;
    bottom: -70px;
    height: 70px;
}

For hiding it again on scrolling: 为了在滚动时再次隐藏它:

$(document).on('scroll',function(){ 
    $('.flyout').animate({
         bottom: '-70px';
    });
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM