Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS css position:fixed not working in ipod Re: css position:fixed not working in ipod

#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'
});
});
}