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

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #37864
    bishtdbest
    Member

    i also used:

    (if(navigator.platform == ‘iPad’ || navigator.platform == ‘iPhone’ || navigator.platform == ‘iPod’) { $( window ).scroll( function ( ) { $( “#” ).css( “top”, ( $( window ).height() + $( document ).scrollTop() -36 ) +”px” ); } ); $(“#fixed-div”).css(“position”, “static”); };)

    plz give perfect soluction… nothing else

    #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'
    });
    });
    }
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.