I am building a website where i have put a scroll animation in which an icon images moves up based on the offset position of the right container content. The logic works great but the animation is choppy in safari and Firefox.
URL - http://ashirvad.xyz/qbf/
Code logic goes something like this:
$(window).scroll(function() {
var height = $(window).height(),
scroll = $(window).scrollTop()
var offsetStart = $('#cardContent').offset();
if (initialOffSetStartPosition.top >= (offsetStart.top -scroll - 1) ) {
$(".nav-sticky").offset({top:offsetStart.top});
}
});
Any help?