Floating div using JQuery
<p>I want a floating div to the right side of the content, I have one script in my hand but shows the div in left side, how to chnage the div position to right by editing the following script.</p>

<p>here is the script..</p>

<pre><code>//avoid conflict with other script
$j=jQuery.noConflict();

$j(document).ready(function($) {

//this is the floating content
var $floatingbox = $('#floating-box');

if($('#body').length &gt; 0){

  var bodyY = parseInt($('#body').offset().top) - 20;
  var originalX = $floatingbox.css('margin-left');

  $(window).scroll(function () { 

   var scrollY = $(window).scrollTop();
   var isfixed = $floatingbox.css('position') == 'fixed';

   if($floatingbox.length &gt; 0){

      //$floatingbox.html("srollY : " + scrollY + ", bodyY : " 
                                //+ bodyY + ", isfixed : " + isfixed);

      if ( scrollY &gt; bodyY &amp;&amp; !isfixed ) {
        $floatingbox.stop().css({
          position: 'fixed',
          left: '50%',
          top: 20,
          marginLeft: -500
        });
    } else if ( scrollY &lt; bodyY &amp;&amp; isfixed ) {
          $floatingbox.css({
          position: 'relative',
          left: 0,
          top: 0,
          marginLeft: originalX
    });
     }      
   }
   });
 }
});
</code></pre>

<p>I'm looking forward to the replies..</p>

<p>Thanks
Paul</p>
