how to fix the position of mask in snapsvg.js?
问题 Here is js code: var cv = Snap('#cv').attr({height: '100%', width: '100%'}); var mskHide = cv.rect().attr({height: '100%', width: '100%', left:0, top:0, fill: '#666'}); var mskShow = cv.circle(200, 200, 150).attr({fill: '#fff'}); var mskG = cv.group(mskHide, mskShow); var bg = cv.circle(200, 200, 150).attr({fill: '#aaa'}); var customImg = cv.image('http://placehold.it/500/990000').attr({mask: mskG}); //when I drag the customImg, I want mskG fixed position customImg.drag(); You can preview