Background Position animation in jQuery not working in Firefox

前端 未结 3 616
迷失自我
迷失自我 2020-12-11 11:49

I am working on a wesbsite here: http://www.benjaminpotter.org/portfolio2/

Look at the loading splash, it looks all good but not in Firefox. Do you know why backgrou

3条回答
  •  囚心锁ツ
    2020-12-11 12:27

    I got mine working with better and simple solution

    First install jquery migration

    https://github.com/jquery/jquery-migrate/#readme

    The $.browser property allows you to target browsers you want to apply your style into

    In this case for background-position can be changed to property supported backgroundPosition

    Available flags are - webkit
    - safari - opera - msie (for IE) - mozilla

    Example for IE or Firefox

    if ( $.browser.msie || $.browser.mozilla) {
                $(".element").css('backgroundPosition', position + "px 0");                
    }
    

    for chrome

    if ( $.browser.webkit) {
                $(".element").css('backgroundPosition', position + "px 0");                
    }
    

提交回复
热议问题