This is working fine:
// left
$('.left p')
.bind('enterviewport', function() {
$(this).animate({
opacity: 1,
marginLeft: 0
}, 400, function() {
// animation complete
});
})
.bullseye();
$('.left p')
.bind('leaveviewport', function() {
$(this).animate({
opacity: 0,
marginLeft: '-100px'
}, 400, function() {
// animation complete
});
})
.bullseye();
But this isnt working at all:
// right
$('.right p')
.bind('enterviewport', function() {
$(this).animate({
opacity: 1,
marginRight: 0
}, 400, function() {
// animation complete
});
})
.bullseye();
$('.right p')
.bind('leaveviewport', function() {
$(this).animate({
opacity: 0,
marginRight: '-100px'
}, 400, function() {
// animation complete
});
})
.bullseye();
And the only difference is the not working one uses “marginRight” instead of “marginLeft” … anyone can see why?