Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/437.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 视差和尺度效应_Javascript_Jquery_Css_Parallax - Fatal编程技术网

Javascript 视差和尺度效应

Javascript 视差和尺度效应,javascript,jquery,css,parallax,Javascript,Jquery,Css,Parallax,我希望在每个图像上使用缩放效果(例如:)进行悬停,但我在jquery脚本中使用了视差效果: 如何使用此脚本实现缩放效果,如何实现 有人成功地解决了我的问题,但使用了其他插件: 我想用Jarallax做这个 div { height:200px; width:400px; background-image:url("http://hdwallpaperbackgrounds.net/wp-content/uploads/2016/07/background-pictures-2.

我希望在每个图像上使用缩放效果(例如:)进行悬停,但我在jquery脚本中使用了视差效果:

如何使用此脚本实现缩放效果,如何实现

有人成功地解决了我的问题,但使用了其他插件: 我想用Jarallax做这个

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;

}
$('div').jarallax({

  // parallax effect speed. 0.0 - 1.0
  speed             : 0.8,

  // path to your parallax image
  imgSrc            : null,

  // width & height of your parallax image
  imgWidth          : null,
  imgHeight         : null,

  // enable transformations for effect if supported. 
  enableTransform   : true,

  // z-index of parallax container.
  zIndex            : null

});

$("div").hover(function(){
    $(this).stop().animate({"opacity":"0.5"});
    }, function(){
    $(this).stop().animate({"opacity":"1"});

});