$(window).ready(function()
{
	$(window).resize(function()
	{
	    refresh();
	});

	$(window).bind('scroll', function()
	{
	    refresh();
	});

	function refresh() 
	{
		var sTop = $(window).scrollTop();
		var wHeight = $(window).height();
		
		$.each($(".plx-img"), function() 
		{
			$(this).css("background-position-y", (
				sTop - $(this).position().top) * (parseFloat($(this).attr('plx-speed')) || 0.1) + (parseFloat($(this).attr('plx-offset')) || 0) + "px");
		});

		$.each($(".plx-float"), function(){
			var ref = $($(this).attr('plx-ref'));
			var relativePos = (sTop + wHeight/2 - ref.position().top - ref.height()/2)/(wHeight/2);
			console.log(relativePos);
			$(this).css("top", ( ( Math.pow( relativePos , 2 ) + 1 ) * (wHeight/2) ) + "px");
		});
	}
});
@@ -505,16 +505,17 @@
 tion()%7B%0A
+%0A
 %09%09%09var r
@@ -547,16 +547,17 @@
 ref'));%0A
+%0A
 %09%09%09var r
@@ -643,36 +643,8 @@
 2);%0A
-%09%09%09console.log(relativePos);
 %0A%09%09%09
@@ -670,18 +670,31 @@
 ( ( 
-Math.pow( 
+relativePos * Math.abs(
 rela
@@ -704,13 +704,8 @@
 ePos
- , 2 
 ) + 
@@ -729,24 +729,28 @@
  ) + %22px%22);%0A
+%09%09%09%0A
 %09%09%7D);%0A%09%7D%0A%7D);

fix floating element coming back