C
C
colddave2016-10-26 00:44:13
css
colddave, 2016-10-26 00:44:13

Why doesn't parallax work in Safari?

https://coldave.github.io/fatman/

$(window).scroll(function() {
    var st = $(this).scrollTop();
    var c = $('.food-menu__wrapper').offset().top;
    var d = st-c-200;
    console.log(d);
    $("#parallOne").css({
      "transform":"translatey("+(st-800)/5+"px"
    });
    $("#parallTwo").css({
      "transform":"translatey("+(st-800)/10+"px"
    });
    if(d>0 && d<518){
      $(".food-menu__big-item-main").css({
        "height":700-d+"px"
      });		
    } 
    if(d>518){
      $(".food-menu__big-item-main").css({
      "height":"200px"
      });			
    }
    if (d>358){
      $(".food-menu__big-item-part-descr").css({
      "opacity":"0"
      });		
    } else{
      $(".food-menu__big-item-part-descr").css({
      "opacity":"1"
      });	
    }

    if(d>157){
      $(".food-menu__big-item-part-descr p").css({
        "opacity":"0"
      });		
    } else{
      $(".food-menu__big-item-part-descr p").css({
        "opacity":"1"
      });				
    }
  });

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question