$(document).ready(function(e) {
$('span#pijlr').click(function(e) {
var slide = 500;
var variable = $('#gallcont').css('left');
var urechts = "-1000px";
if(variable > urechts) {
$('#gallcont').animate({'left': '-=' +slide+ 'px'},'fast','linear');
}
});
$('span#pijll').click(function(e) {
var slide = 500;
var variable = $('#gallcont').css('left');
var ulinks = "0px";
if(variable < ulinks) {
$('#gallcont').animate({'left': '+=' +slide+ 'px'},'fast','linear');
}
});
});
This code i wrote for a simple slide gallery i made. All works fine except when i fast click the arrow buttons. It will go beyond the values i set up (urechts and ulinks).
I tried putting 'stop()' before the .animate, but it didn't help. Hope you guys can give me some advise on how to solve this. Thanks in advance!