Javascript 视差和尺度效应
我希望在每个图像上使用缩放效果(例如:)进行悬停,但我在jquery脚本中使用了视差效果: 如何使用此脚本实现缩放效果,如何实现 有人成功地解决了我的问题,但使用了其他插件: 我想用Jarallax做这个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.
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"});
});