I am trying to add a fixed div to the content wrapper in snap.js (https://github.com/jakiestfu/Snap.js/). Everything I've tried has failed because snap.js pushes the entire canvas with all the fixed elements. Is there any hack for this?
I mocked up the effect I'm trying to achieve here
Update: After further investigation of the issue, I've came to conclusion that this fixed div would require an event listener that would fire an opposite transform:translate3d. The script works by setting transform:translate3d to the same width as the left drawer. Here's the snippet:
x: function(n) {
if( (settings.disable=='left' && n>0) ||
(settings.disable=='right' && n<0)
){ return; }
n = parseInt(n, 10);
if(isNaN(n)){
n = 0;
}
if( utils.canTransform() ){
var theTranslate = 'translate3d(' + n + 'px, 0,0)';
settings.element.style[cache.vendor+'Transform'] = theTranslate;
} else {
settings.element.style.width = (win.innerWidth || doc.documentElement.clientWidth)+'px';
settings.element.style.left = n+'px';
settings.element.style.right = '';
}
Would anyone know how to write an event listener that would set the transform3d for the fixed div to the opposite amount as content container?