缩放视差效果

时间:2017-01-16 12:03:54

标签: javascript jquery html css parallax

这是我的JS FIFFLE https://jsfiddle.net/uo34ru7d/28/

我想在我的div上进行缩放效果,但它对我使用的脚本效果不佳。你会在JS FIDDLE上看得更清楚。

HTML

<div> </div>
<div> </div>
<div> </div>

<script src="https://raw.githubusercontent.com/nk-o/jarallax/master/jarallax/jarallax.js"></script>

CSS

div {
  height:200px;
  width:400px;
  background-image:url("http://hdwallpaperbackgrounds.net/wp-content/uploads/2016/07/background-pictures-2.jpg");
  margin:50px;
  position: relative;
  background-repeat: no-repeat;
    background-position: 50% 50%;
  background-size: cover;
   transition: scale .3s ;

}


div:hover {
     transform: scale(0.95);
}

THE JQUERY SCRIPT

https://github.com/nk-o/jarallax

0 个答案:

没有答案
相关问题