How to make price and add to cart sticky ( fixed to top ) when scrolling down on mobile ?

How to make price and add to cart sticky ( fixed to top ) when scrolling down on mobile ?

So Im using this 

The single _variation_wrap is the class that has both the price and add to cart 

$(document).scroll(function () {
if ($(this).scrollTop() > 40) { 
$("single_variation_wrap").addClass("sticky");
}else{
$("single_variation_wrap").addClass("sticky");
}
});

and then 

.sticky{ position:fixed; top:10px; right:10px; }

But nothing is happening .. Please Anyone?