Open v3nt opened 8 years ago
I have needed the same functionality, but instead of changing the CSS I decided to add a function that gets triggered on resize so that I could unstick the element.
On Line 151 below:
if (newWidth != null) {
s.stickyElement.css('width', newWidth);
}
`s.stickyElement.trigger('sticky-resize', [s]);` // new line added
My function I attached:
$this.on('sticky-resize', function(s) {
var w = $(window).width();
if(w <= 320) {
$this.sticky('unstick');
} else if (w > 320 && w <= 768) {
$this.sticky(options);
} else if (w > 768 && w <= 1024) {
$this.sticky(options);
} else {
$this.sticky(options);
}
});
See also: #211
So on smaller screens its just part of the html flow and not 'fixed' and maybe the inline height is disabled?