creating increment button that shuts off if margin greater then 2800 pxs
<p>I'm making a slider, and I'm trying to figure out how I'd program a button specifically.</p>

<p>I'd like it to move left in increments of 700 pxs on click, but once the marginLeft is greater then 2800 pxs for it not do anything on click.</p>

<p>right now I have the part that moves the container in increments, but I'm not sure how to make the part where it does nothing after "slider_container" has a marginLeft of greater then 2800 px.</p>

<pre><code>$("#left").click(function () {
    $("#slider_container").animate ({
        marginLeft: "+=700px"
    },450 );
});
</code></pre>

<p>I was wondering why the following doesn't work:</p>

<pre><code>if ($("#slider_container").css("marginLeft") &gt;= 2800) {
      $("#right").click(function () {
    $("#slider_container").animate ({
        marginLeft: "-=0px"
    },450 );
});  
}
else
{
    $("#right").click(function () {
    $("#slider_container").animate ({
        marginLeft: "-=700px"
    },450 );
});  

}
</code></pre>
