I have a viewport which i wish to 'overlay' a floating image on it. Everything is fine (including resizing of viewport) however SCROLLING screws up everything as the image just *stays* there on the screen while the background content moves.....
Code:
var coverimage = Ext.create('Ext.Img', {
src: '/images/landing/coverimage.png',
floating: true,
shadow: false
});
Ext.define('Squirt.view.Viewport', {
extend: 'Ext.container.Viewport',
style: 'background: #000000;',
autoScroll: 'vertical',
layout: {
type: 'hbox',
pack: 'center'
},
items: [{
id: 'mainSplash',
border: false,
width: 800,
bodyStyle: 'background: #000000;',
defaults: {
border: false
},
items: [{
height: 91,
bodyStyle: 'background: url(/images/landing/header.jpg);'
}, {
height: 43,
bodyStyle: 'background: url(/images/landing/redbar.png);'
}, {
height: 479,
bodyStyle: 'background: url(/images/landing/greyback.jpg);'
}]
}],
listeners: {
resize: function() {
// var x = (window.innerWidth / 2) - 425;
coverimage.show().alignTo(Ext.get('mainSplash'), 'tl', [ -25, 0 ]);
}
}
});
I guess I thought 'alignTo' would 'lock' the floating image to "mainSpash' so that if mainsplash scrolled
the image would follow it ...
Thanks!
Kevin