jquery.fixer.js
jquery.fixer.js copied to clipboard
Unfixed Method
Hi, Thanks for this great plugin, it work perfectly but I would like to know what is the best way to unfix an element.
I aim to stop the script when my windows.width < 768px
Thanks
Sorry for the late reply, I just forgot this issue.
To unfix an element you could change the selector and reset/remove css "top" and "position".
$('.fixer').fixer();
// ...
$(window).on('resize', function () {
var isSmallDevice = $(window).width() < 768;
if (isSmallDevice) {
$('.fixer').removeClass('fixer').css({
position: '',
top: ''
});
}
});
I added possibility to use $('.selector').fixer('pause');
and $('.selector').fixer('pause');
in pull request #4 with version 1.0.0.
Tks
thx for the feedback