Get device orientation
Well for starters bind the event using the jQuery standard

var $win = $(window).bind('orientationchange', function(){
    // math.abs to reduce logical operators   
    $('body').removeClass('landscape portrait') // reset
        .addClass(Math.abs(this.orientation) === 90 ? "landscape" : "portrait");     
});

// now you can trigger the orientation manually on doc ready to set the class
$win.trigger('orientationchange');

var num = 400,
    $body = $('body'),
    $example = $('.example');

if($body.hasClass("landscape"))
    $example.animate({'bottom', 0});
else
    $example.animate({'bottom', num});