How do I check if browser supports position:fixed
using jQuery. I assume I have to use $.support
I think, but how?
Thank you for your time.
function fixedcheck () {
var fixedDiv = $('').css('position', 'fixed').appendTo('body');
var pos1 = fixedDiv.offset().top;
$(window).scrollTop($(window).scrollTop() + 1);
var pos2 = fixedDiv.offset().top;
fixedDiv.remove();
return (pos1 != pos2)
}
/* Usage */
$(document).ready(function () {
if (!fixedcheck()) alert('Your browser does not support fixed position!')
});