.toggle(function(){},function(){}
) is Deprecated and Removed in version 1.9
You must using greater version than that.
and using .toggle() means to hide and show alternatively.
Display or hide the matched elements.
That's why your code is hiding element with id wrapper
and one click again showing it.
It is this not 'this'
without quotes.
Fiddle Demo
var i = 0,
wrapper = $('#wrapper');
$('a.navToggle').click(function () {
if (i++ % 2 == 0) {
wrapper.removeAttr('style').animate({
right: '200px'
}, 900);
} else {
wrapper.removeAttr('style').animate({
left: '200px'
}, 900);
}
});