背景
我允许用户在蒙版图片中上传一个图像....
一旦用户上传了图像,我会将用户上传的图像填充到蒙版图像中:
1. 蒙版图像 :
2. 用户上传的图像 :
3. 蒙版上的用户上传的图像 [最终图像] :
Codepen : https://codepen.io/kidsdial2/pen/OdyemQ
JSfiddle : http://jsfiddle.net/2xq8p0zy/
Html
<body>
<img src="http://139.59.24.243/images/invitations/birthday/a.jpg" alt="">
</body>
层叠样式表
body {
background-color: #111;
color: #555;
font-size: 1.1em;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
img {
margin: 20px auto;
display: block;
width: 100%;
height: 500px;
-webkit-mask-image: url(http://139.59.24.243/images/invitations/birthday/ice.png);
mask-image: url(http://tympanus.net/codrops-playground/assets/images/cssref/properties/mask-image/mask-image.png);
-webkit-mask-position: center center;
mask-position: center center;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
}
需求:
我希望提供一个选项,让用户可以在遮罩图像内移动上传的图像,如这个 示例 或者 链接 中所示。
问题 :
但是目前在网站上,两张图片都在移动...