Home › Forums › CSS › css position:fixed not working in ipod › Re: css position:fixed not working in ipod
May 1, 2012 at 6:26 am
#102061
SgtLegend
Member
The value fixed
only works on iOS 5.x so it’s not wise to rely on CSS as many iDevice users still use iOS 4.x, however the above code would work with a few modifications as currently your not targeting any element. See the updated code below.
if (navigator.platform.match(/iP(od|hone|ad)/i)) {
$(window).scroll(function() {
$('#fixed-div').css({
position : 'absolute',
top : ($(window).height() + $(document).scrollTop() - 36) + 'px'
});
});
}