I\'m making a slider, and I\'m trying to figure out how I\'d program a button specifically.
I\'d like it to move left in increments of 700 pxs on click, but once the mar
alright, I got it working, here's the solution I came up with:
$("#right").click(function () {
if (parseInt($("#slider_container").css("marginLeft")) < -2100) {
$("#slider_container").animate ({
marginLeft: -2800
},450 );
}
else
{
$("#slider_container").animate ({
marginLeft: "-=700px"
},450 );
}
});
$("#left").click(function () {
if (parseInt($("#slider_container").css("marginLeft")) > -699) {
$("#slider_container").animate ({
marginLeft: 0
},450 );
}
else
{
$("#slider_container").animate ({
marginLeft: "+=700px"
},450 );
}
});