I have created a custom scroll. In which I am shifting the contents right and left by increasing or decreasing the margin. I want to restrict the div not to margin more when the last or first content is visible or you can say I want to make it like scroll. How I can restrict the div not to move anymore
$('#left').live('click' , function(){
$('#myDiv').css("margin-left","-=10px");
})
$('#right').live('click' , function(){
$('#myDiv').css("margin-left","+=10px");
})