Grow your CSS skills. Land your dream job.

css position:fixed not working in ipod

  • # May 1, 2012 at 5:39 am

    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

    # May 1, 2012 at 6:26 am

    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)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".