im not too good with jquery/javascript, im more of a backend guy, but im trying to make a box move on a button click and stop at a certain position(well make the button hide at that position.
heres kind of what i have:
HTML:
Code
<button onclick = "next()" id="nextbtn">Next</button>
<div id = "scroll_box">
stuff in here
<div>
Javascript:
Code
function next() {
$(document).ready(function(){
$("#scroll_box").animate({"left":"-=400px"}, "slow");
var offset = $("#scroll_box").offset();
if ($("#scroll_box").offset.left >= 800px) {
$("#nextbtn").hide();
}
});
}
it will move (with out that offset code) but im not 100% sure how to get it to stop moving.
any help would be appreciated, if you need anymore info, let me know thanks!
This post was edited by Huayra on Aug 30 2012 12:01pm