I have a drag and drop script where I drag div.slider, I track the "left" value for div.slider and lose it when it is more than 68, but the problem is that it disappears when it reaches 6, not 68 If I change the number to 85, then it will disappear by 8, not 85. Does anyone know why this is happening?
$(document).ready(function() {
$(".slider").mousemove(function() {
var rightStyleValue = $('div.slider').css('left');
$('.display_value').html(rightStyleValue);
if ($('.slider').css('left') > 68 + 'px') {
$('.container').fadeOut(500);
}
});
});
source
share