Javascript Tweenlite背景图像保持稳定
我现在对Tweenlite js的背景图像有一个问题。 所以在这段代码中,我在背景上设置了一张地图,上面的一些点作为不同的图像,但仍然在背景中。 你可以在这里看到它Javascript Tweenlite背景图像保持稳定,javascript,html,css,gsap,Javascript,Html,Css,Gsap,我现在对Tweenlite js的背景图像有一个问题。 所以在这段代码中,我在背景上设置了一张地图,上面的一些点作为不同的图像,但仍然在背景中。 你可以在这里看到它 http://socialextensions.eu/maptest/gigi/index.html 现在,当我移动鼠标时,所有图像都左右浮动,但我只希望点移动,贴图保持稳定。 我做了一些调查,但运气不好 这是密码 html内部脚本 css 有人知道吗 我已经尝试更改了.5,您可以在js代码中看到parseInt(event.pa
http://socialextensions.eu/maptest/gigi/index.html
现在,当我移动鼠标时,所有图像都左右浮动,但我只希望点移动,贴图保持稳定。
我做了一些调查,但运气不好
这是密码
html内部脚本
css
有人知道吗
我已经尝试更改了.5
,您可以在js代码中看到parseInt(event.pageX/8)
,但它只是缓慢移动
还尝试像这样将css放到特定的url图像中
body
{
background-color: #242424;
background-size: cover;
padding: 0;
margin: 0;
background: url(../images/mapbg.jpg) no-repeat center center fixed;
background-color: #444;
background: url(http://mymaplist.com/img/parallax/pinlayer2.png),url(http://mymaplist.com/img/parallax/pinlayer1.png),url(../images/mapbg.jpg) no-repeat center center fixed;
background-repeat: no-repeat;
}
非常感谢您的时间。我认为这是因为您将所有图像应用于与
背景
图像相同的主体
元素。为了创建您想要的视差效果,您需要为每个背景
图像创建单独的层,然后只针对要在鼠标移动
上设置动画的图像。
body
{
background-color: #242424;
background-size: cover;
padding: 0;
margin: 0;
background: url(../images/mapbg.jpg);
background-color: #444;
background: url(http://mymaplist.com/img/parallax/pinlayer2.png),url(http://mymaplist.com/img/parallax/pinlayer1.png),url(../images/mapbg.jpg);
background-repeat: no-repeat;
}
body
{
background-color: #242424;
background-size: cover;
padding: 0;
margin: 0;
background: url(../images/mapbg.jpg) no-repeat center center fixed;
background-color: #444;
background: url(http://mymaplist.com/img/parallax/pinlayer2.png),url(http://mymaplist.com/img/parallax/pinlayer1.png),url(../images/mapbg.jpg) no-repeat center center fixed;
background-repeat: no-repeat;
}